S
slacroixak
Guest
Hi Thomas, Mike, Laura, Peter and all, For unexpected exceptions that can be either low level ABL errors (Progress.Lang.ProError = plp) or errors of my own App (Progress.Lang.AppError = pla) I like to use the generic interface with a single CATCH Progress.Lang.Error (ple) block, then I use a little utility getErrorMessages() method in a static class (see below). The reason why I do that is I consider I extend the language with my App. I may use my own App Error objects as well when appropriate, with some extra catch block(s) prior to the last generic ple, but so far, it happens rather rarely I should not have a problem to handle a SysError with that, should I? /Sébastien L. METHOD PUBLIC STATIC CHARACTER getErrorMessages(ple AS Progress.Lang.Error): DEFINE VARIABLE iMaxMsg AS INTEGER NO-UNDO. DEFINE VARIABLE iMsg AS INTEGER NO-UNDO. DEFINE VARIABLE cMessageDetails AS CHARACTER NO-UNDO. DEFINE VARIABLE pla AS Progress.Lang.AppError NO-UNDO. pla = CAST(ple, Progress.Lang.AppError) NO-ERROR. iMaxMsg = ple:NumMessages. DO iMsg = 1 TO iMaxMsg: cMessageDetails = cMessageDetails + "~n" + ple:GetMessage(iMsg). END. IF VALID-OBJECT(pla) THEN cMessageDetails = cMessageDetails + "~n" + pla:ReturnValue. RETURN SUBSTRING(cMessageDetails, 2). END METHOD.
Continue reading...
Continue reading...