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