Reply to post: Re: Well, this article'll cause some arguments, eh?

'Boss, I've got a bug fix: Nuke the whole thing from orbit, rewrite it all'

itzman
Linux

Re: Well, this article'll cause some arguments, eh?

Actually my favourite if I need a goto style fatal error handler is setjmp()/longjmp() and friends.

No matter where you are, or how deeply nested, you end up in a high level error handler that can examine the state of the machine, decide what to do, and do it.

Better still...

if(err=setjmp(Env))

DoErrorStuff(err);

...means that ALL your fatal error handling is well away from the code that is doing the real business of the program.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon