Errors management in progress

4GLNewbie

Member
I searched the forum to find out something about that, but i didnt find what i needed.

The question is: how are errors managed in progress?

I mean, messages that are raised when executing tasks on the db.
In other languages there are try-catch statements. Is this avaiable only in new versions of progress?
And if so, is a way to manage in a similar way an error raised?

To be more specific, i dont want to show a message-box that say something like "update failed because string length is greater that filed x length" ( or in general other messages of this type ), but still need to manage the exception in the code...

I hope there was not already a thread with this info in it.
Bye!
 
And if so, is a way to manage in a similar way an error raised?

To be more specific, i dont want to show a message-box that say something like "update failed because string length is greater that filed x length" ( or in general other messages of this type ), but still need to manage the exception in the code...

For older versions you can use the 'ON ERROR/etc...' style constructs, but the simple answer may be to use the 'NO-ERROR' clause, which tells Progress to omit any normal warning messages, and then handle any errors yourself.

Used excessively, this can be bad practise for various reasons, eg. you may forget to put in your handling code, and you should arguably test before the error is thrown anyway when using this mechanism.

eg.

<do something> NO-ERROR. /* do something, but supress the default error message */

IF ERROR-STATUS:NUM-MESSAGES > 0 THEN /* something bad happened */

See Knowledgebase P25943 "How to deal with Error Processing ?" for more info along these lines.
 

4GLNewbie

Member
Thanks for your quick answers..
I ll give a look to your links, thanks a lot.

I have an 9.[something] version, forgot to tell.
Thanks a lot again.
 
Top