User Tools

Site Tools


takebenign_process_benign_error_.htm
Navigation:  ABC Library Reference > ErrorClass > ErrorClass Methods >====== TakeBenign (process benign error) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

TakeBenign, PROTECTED, VIRTUAL, PROC

blk2blue.jpg

The TakeBenign method is called when an error with Level:Benign is “Thrown” to the ErrorClass (see Throw, ThrowFile, ThrowMessage).

TakeBenign must return a severity level.

Implementation:

The base class method (ErrorClass.TakeBenign) returns Level:Benign.

Return Data Type:     BYTE

Example:

 INCLUDE('ABERROR.INC')           !declare ErrorClass

MyErrorClass CLASS(ErrorClass)     !declare derived class

TakeBenign   FUNCTION,BYTE,VIRTUAL !prototype corresponding virtual

            END

GlobalErrors MyErrorClass          !declare GlobalErrors object

CODE

GlobalErrors.Init                 !GlobalErrors initialization

 

!normal code here, if error

 

GlobalErrors.Throw(Msg:NoError)  !Throw method calls SELF.TakeBenign to

                    !automatically call the derived class method

                    !rather than the base class method

MyErrorClass.TakeBenign FUNCTION   !derived class virtual to handle benign errors

CODE

 !your custom code here

RETURN Level:Benign

See Also:     TakeError, Throw, ThrowFile, ThrowMessage

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