Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Function GetException(Message : String) : Aggregate Of Exception
  • Procedure CancelException

 

...

titleExpress Helper functions and procedures
linenumberstrue
collapsetrue

Function

...

GetException(Message

...

:

...

String)

...

:

...

Aggregate

...

Of

...

Exception;

...


   Local
      lInnerException : Exception;
      lMessage : String;
      lKeep : Boolean := True;
   End_Local;
   If NVL(xpxExceptionId.errCode,

...

0)

...

<>

...

0

...

Then
      --

...

EDM

...

error
      --

...

Avoid

...

reporting

...

the

...

same

...

error

...

twice
      Repeat I := 1 To xpfSizeOf(GExceptions);

...


         If (GExceptions[I].errCode

...

=

...

xpxExceptionId.errCode)

...

And
            (GExceptions[I].

...

lineNumber =

...

xpxExceptionId.lineNumber)

...

Then
            lKeep := False;
            Escape;
         End_If;
      End_Repeat;
      If lKeep Then
         lInnerException := GException;
         New GException;
         GException._Type_         := 'edmException';
         GException.errCode        := xpxExceptionId.errCode;
         GException.errMessage     := xpfGetErrorText(xpxExceptionId.errCode);

...


         GException.functionName   := xpxExceptionId.functionName;

...


         GException.lineNumber     := xpxExceptionId.lineNumber;

...


         GException.innerException

...

:=

...

lInnerException;

...


         lMessage :=

...

xpfStringPrintf('Line

...

#%d:

...

Exception.

...

EDM

...

Error

...

number:

...

%d,

...

Message:

...

%s',

...

NVL(xpxExceptionId.lineNumber,

...

xpxCurrentLine),

...

GException.errCode,

...

GException.errMessage);

...


         xpxPrintf('%s\n', lMessage);

...

xpxDebugPrintf('%s\n', lMessage);

...


         GExceptions ++

...

GException;

...


       End_If;

...


   End_If;

...


   If NVL(Message,

...

'')

...

<>

...

''

...

Then
      lInnerException :=

...

GException;

...


      New GException;
      GException._Type_

...

         :=

...

'xpxException';

...


      GException.userMessage    :=

...

Message;

...


      GException.innerException

...

:=

...

lInnerException;

...


      lMessage :=

...

xpfStringPrintf('Line

...

#%d:

...

Exception:

...

Message:

...

%s',

...

NVL(xpxExceptionId.lineNumber,

...

xpxCurrentLine),

...

GException.userMessage);

...


      xpxPrintf('%s\n', lMessage);

...

xpxDebugPrintf('%s\n', lMessage);

...


      GExceptions ++

...

GException;

...


   End_If;

...


   Return(GExceptions);

...


End_Function;

...

Code Block
titleExpress Helper functions and procedures
linenumberstrue
collapsetrue
 
-- To ignore an exception from lower level and continue
-- execution as normal call the following function.
Procedure CancelException;
   GExceptions := [];
   GException := ?;
End_Procedure;
---------------------------------------------------------------------------------------------

...