Program logic bugs vs input/environmental errors

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 24 12:09:20 PDT 2014


On 10/24/2014 11:29 AM, Ary Borenszweig wrote:
> On 9/27/14, 8:15 PM, Walter Bright wrote:
> Now, imagine I have an assert in my application. When the web server hits the
> assertion it shuts down and the user doesn't get a response. What I'd like to do
> is to trap that assertion, tell the user that there's a problem, and send me an
> email telling me to debug it and fix it. That way the user can continue using
> the bot and I meanwhile I can fix the bug.

Don't need an exception for that.

You can insert your own handler with core.assertHandler(myAssertHandler). Or you 
can catch(Error). But you don't want to try doing anything more than 
notification with that - the program is in an unknown state.



More information about the Digitalmars-d mailing list