IBM Support

How to use the Global Error Policy to Catch Errors

How To


Summary

The Assembly catch allows users to handle errors thrown during the assembly execution.

Some errors returned from the assembly cannot be handled by the Assembly catch. To handle these errors, use the global error policy. Below is a list of errors that require the global error policy, details of how to initiate the error and the sample response that is returned by the error:


1.Error name:APIRuleError
How to initiate error: Forget to pass a required parameter.

Sample Response:
{
"httpCode": "400",
"httpMessage": "Bad Request",
"moreInformation": "One or more required API parameters are missing in the API request."
}

2.Error Name: UnauthorizedError
How to initiate error: Provide a wrong client-ID or client-secret.
Sample Response
{
"httpCode": "401",
"httpMessage": "Unauthorized",
"moreInformation": "Invalid client id or secret."
}

Note:
When you call an API with a URI path that does not exist or is not defined it will throw an Error of type APIRuleError, however this error cannot be caught in the global error policy.

Sample response
{
"httpCode": "404",
"httpMessage": "Not Found",
"moreInformation": "No resources match requested URI"
}

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSMNED","label":"IBM API Connect"},"ARM Category":[{"code":"a8m50000000CeEfAAK","label":"API Connect-\u003EDeveloper (DV)-\u003EPolicy"}],"ARM Case Number":"TS015474644","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
22 May 2024

UID

ibm17137309