Error and Exception Handling
Error Handling for NITRO APIs
-
Error in a Single Resource Operation
-
Error in a Bulk Operations
-
Warnings
-
Error in a Single Resource OperationThe response of a single erroneous operation is as follows: -
ResponseHTTP Status Code:4xx \<string\> (for general HTTP errors) or 5xx \<string\> (for Citrix-ADC-specific errors)
Response Header: Content-Type:application/json
Response Payload:
{
errorcode: <Error code>,
message: "<Error message>",
severity: "ERROR"
}
-
Error in a Bulk OperationWhen there is a failure in one of the bulk operations, the response payload gives a combination of success and failure (depends on the value set for X-NITRO-ONERROR in the request header). -
ResponseHTTP Status Code:207 Multi Status
Response Header: Content-Type:application/json
Response Payload when X-NITRO-ONERROR is set to continue:
{
"errorcode": 1243,
"message": "Bulk operation failed",
"severity": "ERROR",
"response":
[
{
"errorcode": 273,
"message": "Resource already exists",
"severity": "ERROR"
},
{
"errorcode": 0,
"message": "Done",
"severity": "NONE"
}
]
}
Response Payload when X-NITRO-ONERROR is set to exit:
{
"errorcode": 1243,
"message": "Bulk operation failed",
"severity": "ERROR",
"response":
[
{
"errorcode": 273,
"message": "Resource already exists",
"severity": "ERROR"
}
]
}
-
Warnings in NITRO OperationsWarnings can be captured by specifying the "warning" query parameter as "yes" when performing any NITRO operation. For example, to get warnings while connecting to the Citrix ADC appliance, the URL is as follows:
-
ResponseHTTP Status Code:209 X-NITRO-WARNING
Exception Handling Support for SDKs
-
Session ID. The session in which the exception occurred. -
Severity. The severity of the exception: error or warning. By default, only errors are captured. To capture warnings, you must set the warning flag to true, while connecting to the appliance. -
Error code. The status of the NITRO request. An error code of 0 indicates that the NITRO request is successful. A non-zero error code indicates an error in processing the NITRO request. -
Error message. Provides a brief description of the exception.