exceptions vs error codes

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 13 06:31:03 PDT 2016


On Wednesday, 13 July 2016 at 13:13:45 UTC, Chris Wright wrote:
as Error can be thrown anywhere along the way (think, for 
example, about RangeError in expression with side-effects), and 
stack unwinding is not guaranteed (but *may* happen, and may 
happen partially), the program *is* in undefined state. that is 
why Errors aren't usual Exceptions, and that is why you should 
not assume *anything* after Error is thrown.

of course, some assumptions still can be made, but they all 
highly implementation-specific, and should be avoided in good 
code.


More information about the Digitalmars-d mailing list