User Tools

Site Tools


takeother_process_other_error_.htm
Navigation:  ABC Library Reference > ErrorClass > ErrorClass Methods >====== TakeOther (process other error) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

TakeOther, PROTECTED, VIRTUAL, PROC

blk2blue.jpg

The TakeOther method is called when an error with an unrecognized severity level is “Thrown” to the ErrorClass (see Throw, ThrowFile, ThrowMessage). By default, an “other” error is treated as a program error.

TakeOther must return a severity level.

Implementation:

The base class method (ErrorClass.TakeOther) calls TakeProgram.

Return Data Type:     BYTE

Example:

 INCLUDE('ABERROR.INC')            !declare ErrorClass

MyErrorClass CLASS(ErrorClass)      !declare derived class

TakeOther    FUNCTION,BYTE,VIRTUAL  !prototype corresponding virtual

      END

GlobalErrors MyErrorClass           !declare GlobalErrors object

CODE

GlobalErrors.Init                  !GlobalErrors initialization

!program code

GlobalErrors.Throw(Msg:CreateFailed) !Throw calls SELF.TakeOther to

                   !automatically call the derived class method

                   !rather than the base class method

!program code

MyErrorClass.TakeOther FUNCTION !derived class virtual to handle “other” errors

 CODE

!your custom code here

RETURN Level:Program

See Also:     TakeError, Throw, ThrowFile, ThrowMessage

takeother_process_other_error_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1