Setting the result as soon as you know it is good programming, whether a later exception will prevent returning it or not.
You don't know the result of a function until the function returns _normally_. Unless a function executes successfully - which includes not exiting through an exception - it shouldn't be setting a result indicating that it executed successfully since it obviously didn't.
Of course it is better, as I said above, to try to avoid the possibility of that later exception--which may or may not be easily done.
Apparently some people (no idea who they are, of course) have difficulties writing decent code. If writing good code is too difficult for someone then they should probably be doing something else - hopefully something they have some talent for, which makes it relatively easy for them to do it right.
Which is good forum etiquette.
At least you're concerned about good forum etiquette. Add concern for good code to that and you're all set.
As it is also good etiquette not to stay off-topic for too long, this is my last post about this. Ciao!
That is good news. Hopefully this time it will actually be that way.
Additionally, it seems you didn't notice that I replied to Serge, not to you.
Ciao (hopefully.)