.NET Utility Errors (Magic xpi 4.14)
You can add new .NET utility error codes to Magic xpi as follows:
-
From the Solution Explorer's Repositories section, select Errors. The Errors Repository opens.
-
From the Components drop-down list at the top of the repository, select User Error.
-
Click Add.
Throwing the errors is done by setting the ErrorCode and ErrorMessage properties of the IBFlowContext object in the Invoke method of the .NET class. The ErrorCode property value should be one of the .NET utility errors predefined in the Magic xpi Errors Repository. In this repository you can filter for .NET utility errors by selecting the .NET option from the Components drop-down list.
In the Error Policies repository, you can define the error behavior for the errors that the .NET step can throw.
The C.sys.ErrorCode and C.sys.ErrorDescription context variables will be updated in the following ways:
-
If you update both the ErrorCode and ErrorMessage in .NET, then Magic xpi updates the above context variables with the value updated in the .NET code.
-
If you update the ErrorCode in .NET and not the ErrorMessage, then Magic xpi updates the C.sys.ErrorCode variable with the ErrorCode defined in the .NET code, maps to the Errors Repository with the ErrorCode, and updates the C.sys.ErrorDescription variable with the value defined in the Errors Repository.
-
If an exception is thrown, then Magic xpi updates the C.sys.ErrorCode variable with 777 and updates the C.sys.ErrorDescription variable with the exception thrown from the .NET code.
-
If you update the ErrorCode that is not defined in the User Error list, then the Error Code does not exist for the selected component error appears.