BBjAPI::getErrorInfo

Description

In BBj 17.00 and higher, the BBjErrorInfo object encapsulates assorted error information from a specific instant in time, typically captured in an error handler.

Syntax

Return Value

Method

BBjErrorInfo

getErrorInfo()

BBjErrorInfo getErrorInfo(int level)

Parameters

Variable Description
level The program level of the error you're interested in, if different from the current program level. For example, if the error information is being retrieved in a global ERROR_HANDLER or ESCAPE_HANDLER, use getErrorInfo(tcb(13)-1) to retrieve information about the error that triggered the call to the global handler program.

Return Value

Returns a BBjErrorInfo object.

Example

rem ' BBjAPI::getErrorInfo Example

rem ' BBjErrorInfo
begin
gosub info
i = sqr(-1,err=*next)
gosub info
stop

info:
    info! = bbjapi().getErrorInfo()
    print fill(60,"=")
    print "BBjAPI::getErrorInfo = ",info!
    print "BBjErrorInfo::getLevel =",info!.getLevel()
    print "BBjErrorInfo::getProgram = ",info!.getProgram()
    print "BBjErrorInfo::getStatement = ",info!.getStatement()
    print "BBjErrorInfo::getErr =",info!.getErr()
    print "BBjErrorInfo::getHostErr =",info!.getHostErr()
    print "BBjErrorInfo::getErrLine =",info!.getErrLine()
    print "BBjErrorInfo::getErrMes = ",info!.getErrMes()
return

See Also

BBjAPI

BBjErrorInfo

TCB() Function - Task Control Block

STBL("!ERROR_HANDLER")

STBL("!ESCAPE_HANDLER")

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.