Why is my app throwing an access violation in System._HandleException? Because I wrote:
raise TMyException(SomeString);
…instead of:
raise TMyException.Create(SomeString);
I’m posting it here so that I can find it with Google the next time I make this mistake.
{ 2 } Comments
Ouch, that mistake is surely a way to waste hours and hours staring at aparently perfectly good code, wondering where the problem is. I’ve been there, except it was a constructor of a regular class instead of an exception.
Kind of worse, because the "owner" got typecasted to another class and would aparently work until it did not. Not fun.
Been there, done that, bought the tee-shirt, bang head against desk, drank beer and when it was brought up in conversation later on we all laughed nerviously and quickly changed the topic.
Post a Comment