I have code where in the main UNIT, I test for various problems and if I find one that I expect, I CREATE my own EXCEPTION and RAISE it:
type
EFatalError = class (Exception);
.....
RAISE eFatalError.Create ('helpful message');
This works great and I get a helpful message explaining what went wrong.
However, I have a UNIT full of common routines which appears in the USE statement of this main UNIT.
Common PROCEDURES and FUNCTIONS in this USEd unit also use the same exception raising coding that the main unit used.
The problem is that my attempt to raise exceptions from the common unit do not appear to work - I never get the message.
I really don't know what to do at this point. I tried to see if constructs like FormMain.RAISE or RAISE FormMain.eFatalError.Create and they are all bogus. I get the suspicion that the exception is not raised up the tree of calling units.
I am dead in the water at this point and would greatly appreciate any help or suggestions.
Thanks so much in advance,
Regards,
Tom
type
EFatalError = class (Exception);
.....
RAISE eFatalError.Create ('helpful message');
This works great and I get a helpful message explaining what went wrong.
However, I have a UNIT full of common routines which appears in the USE statement of this main UNIT.
Common PROCEDURES and FUNCTIONS in this USEd unit also use the same exception raising coding that the main unit used.
The problem is that my attempt to raise exceptions from the common unit do not appear to work - I never get the message.
I really don't know what to do at this point. I tried to see if constructs like FormMain.RAISE or RAISE FormMain.eFatalError.Create and they are all bogus. I get the suspicion that the exception is not raised up the tree of calling units.
I am dead in the water at this point and would greatly appreciate any help or suggestions.
Thanks so much in advance,
Regards,
Tom