Navigation: ABC Library Reference > ErrorClass > ErrorClass Methods >====== TakeBenign (process benign error) ====== | |
TakeBenign, PROTECTED, VIRTUAL, PROC
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