Question error call stack

mcounad

New Member
Hi!

During the development of error handling mechanism (in webspeed), I met the following issue.

By default, when error occurs, webspeed writes (error message + procedure and line where error appeared) to the agent server.log.

I'm using global CATCH statement + BLOCK-LEVEL ON ERROR UNDO, THROW, to catch all errors occured in application. In this case, errors won't be automatically written to log. I can manually write error messages to log, using getMessage() method of SysError class, it's not a problem:) But how I could write procedure and line where error appeared ?

I tried with callStack attribute, but I don't want use it because of following reasons:
1) Progress doesn't recomend this option, because it requires additional overhead.
2) I don't need the full call stack, just concrete place where error appeared.

Is there any other possibilities to to deal with this issue ?

Thank you in advance,
Alex
 

GregTomkins

Active Member
Would &FILE-NAME, &LINE-NUMBER help, eg. in the THROW statement? I have my doubts, and haven't used them myself.

Your concern #1 about using callStack sounds not valid because you probably shouldn't be CATCHing errors very often. If you are, you probably have bigger problems. Eg., you generally shouldn't use THROW/CATCH for routine things that happen often enough to care about overhead.
 

mcounad

New Member
Would &FILE-NAME, &LINE-NUMBER help, eg. in the THROW statement? I have my doubts, and haven't used them myself.

Your concern #1 about using callStack sounds not valid because you probably shouldn't be CATCHing errors very often. If you are, you probably have bigger problems. Eg., you generally shouldn't use THROW/CATCH for routine things that happen often enough to care about overhead.

Thank you for response, Greg!

I'm catching system errors (Progress.Lang.SysError class), so there is no THROW statement where I could specify custom error message.
In the CATCH block I have only SysError object, that doesn't contain any information about file and line..

About my concern #1 : I don't know how call stack implemented in Progress. May be, to keep this stack, ABL writes there every procedure call, independently, thrown there error or not. In this case, additional overhead will exist, even if there will be no errors.
 
Top