Error Handling Variables (Magic xpi 4.9)
Magic xpi provides variables that you can use for error handling in your project flows.
-
The value of the following variables are cleared once the step is completed:
-
-
C.sys.ErrorCode: Each time the server executes a step, if the step returns an error code, the C.sys.ErrorCode variable will be updated with this error code. The value of this variable is cleared once the step is completed.
-
C.sys.ErrorDescription: Each time the server executes a step, if the step returns an error, the C.sys.ErrorDescription variable will be updated with the error description. The value of this variable is cleared once the step is completed.
-
The values of the following variables (the “Last” variables) are not cleared when the step is completed.
-
-
C.sys.LastErrorFlowName: Each time the server executes a step, if the step returns an error code, the C.sys.LastErrorFlowName variable will be updated with the name of the flow in which the error occurred.
-
C.sys.LastErrorStepName: Each time the server executes a step, if the step returns an error code, the C.sys.LastErrorStepName variable will be updated with this step's name.
-
C.sys.LastErrorInfo: Holds detailed information about the error (for example, SQL statement).
-
C.sys.LastErrorCode: Each time the server executes a step, if the step returns an error code, the C.sys.LastErrorCode variable will be updated with this error code.
-
C.sys.LastErrorDescription: Each time the server executes a step, if the step returns an error, the C.sys.LastErrorDescription variable will be updated with the error description.
-
C.sys.LastErrorComponentType: Each time the server executes a step, if the step returns an error code, the C.sys.LastErrorComponentType variable will be updated with the component type in which the error occurred (component ID).
All of the above are context variables and not global variables; thus, in various flows running in parallel it may have a different value.
Each component has its own error codes. If you want to raise an error, you must update the error number in C.sys.ErrorCode and the relevant component type (ID) in C.sys.LastErrorComponentType.