%SYSTEM.Status
Class %SYSTEM.Status Extends Help [ Abstract, System = 3 ]
This is a helper class that is used to construct and display/decompose status codes.
Many methods in this class use the qspec argument, which is a list of flags or qualifiers. See System Flags and Qualifiers.
Methods
Error
ClassMethod Error(errorcode As %Integer, message1 As %String, message2 As %String, message3 As %String) As %Status [ CodeMode = expression ]
Return an error status code with the error as specified by the errorcode. Some error codes accept addition parameters as embedded message in the error text.
AppendStatus
ClassMethod AppendStatus(statuscode1 As %Status, statuscode2 As %Status) As %Status [ CodeMode = expression ]
Return a new status code that is the combination of the two status codes. For example, if both statuscode1 and statuscode2 contain errors, then the new status code will contain 2 error messages.
EmbedStatus
ClassMethod EmbedStatus(statuscode1 As %Status, statuscode2 As %Status) As %Status [ CodeMode = expression ]
IsError
ClassMethod IsError(statuscode As %Status) As %Boolean [ CodeMode = expression ]
Returns 1 if the statuscode contains errors. Otherwise, it returns 0.
IsOK
ClassMethod IsOK(statuscode As %Status) As %Boolean [ CodeMode = expression ]
Returns 1 if the statuscode does not contain errors. Otherwise, it returns 0.
DisplayError
ClassMethod DisplayError(statuscode As %Status) As %Status [ CodeMode = expression ]
Display the error text for statuscode.
DecomposeStatus
ClassMethod DecomposeStatus(statuscode As %Status, ByRef errorlist, qspec As %String, language As %String) As %Status
Returns the error text and error information for statuscode; this information is returned by reference through the errorlist parameter. The errorlist parameter is a multidimensional array containing information about each error. If the errorlist array already contains values, the method appends the new values.
If the qspec parameter contains the "d" flag, then the error text is also displayed to the screen.
To return the error text in a different language, pass a language code as the language parameter.
GetErrorCodes
ClassMethod GetErrorCodes(statuscode As %Status) As %String
Returns the error codes for statuscode as a comma-delimited list.
GetErrorText
ClassMethod GetErrorText(statuscode As %Status, language As %String) As %String [ CodeMode = expression ]
Returns the error text for statuscode. If there is more than one error in the statuscode, then the multiple error text strings are separated by
To return the error text in a different language, pass a language code as the language parameter.
GetOneErrorText
ClassMethod GetOneErrorText(statuscode As %Status, index As %Integer, language As %String) As %String [ CodeMode = expression ]
Returns the error text for the error in the statuscode at position index.
To return the error text in a different language, pass a language code as the language parameter.
GetOneStatusText
ClassMethod GetOneStatusText(statuscode As %Status, index As %Integer, language As %String) As %String [ CodeMode = expression ]
Returns the inner text for the error in the statuscode at position index,. without the error domain, id or source.
To return the error text in a different language, pass a language code as the language parameter.
Equals
ClassMethod Equals(statuscode As %Status, statusids...) As %Boolean [ CodeMode = expression ]
Return true if the domain/msgid of statuscode equals any of the following error code domain/msgid arguments
OK
ClassMethod OK() As %Status [ CodeMode = expression ]
Returns the success status code.
StatusToSQLCODE
ClassMethod StatusToSQLCODE(statuscode As %Status, Output message As %Library.String(MAXLEN=500), language) As %Integer [ CodeMode = expression ]
Return an SQLCODE equivalent to the statuscode. message contains the status text. Precise error code to SQLCODE value are only possible for SQLCODE errors - $$$SQLCode and $$$SQLError. All other error numbers translate to -400.