Error Handling
When using the PDFBOLT API, you may encounter various HTTP status codes indicating the outcomes of your requests. Understanding these codes can help you determine whether your request was successful or if there are issues that need to be addressed.
HTTP Status Codes
Below is a table of common HTTP status codes, their meanings, and recommended actions:
HTTP Status Code | errorCode | Meaning | Recommended Action |
---|---|---|---|
200 | null | The request has succeeded, and the server has returned the requested data. |
|
400 | INVALID_REQUEST | The server could not understand the request due to invalid syntax. |
|
401 | UNAUTHORIZED | Authentication is required and has failed or has not been provided. |
|
403 | FORBIDDEN | You do not have permission to access the requested resource. |
|
404 | NOT_FOUND | The requested resource could not be found on the server. |
|
413 | PAYLOAD_TOO_LARGE | The request entity is larger than the server is willing or able to process. |
|
429 | TOO_MANY_REQUESTS | You have exceeded the allowed number of requests in a given time frame. |
|
500 | INTERNAL_SERVER_ERROR | The server encountered an unexpected condition that prevented it from fulfilling the request. |
|
503 | SERVICE_UNAVAILABLE | The server is currently unable to handle the request due to temporary overload or maintenance. |
|
504 | GATEWAY_TIMEOUT | The server did not receive a timely response from an upstream server. |
|
Error Response Format
In the event of an error, the API will return a JSON-formatted response containing details about the issue.
The structure of the error response is as follows:
{
"timestamp": "2024-11-19T23:59:59Z",
"httpErrorCode": 504,
"errorCode": "GATEWAY_TIMEOUT",
"errorMessage": "Timeout exceeded. Check parameters such as waitForFunction, waitForSelector, and timeout in your request."
}
Error Response Fields
Property Name | Type | Description |
---|---|---|
timestamp | string | The date and time when the error occurred, in ISO 8601 format (UTC). |
httpErrorCode | number | The HTTP status code of the error. |
errorCode | string | Refer to errorCode values in the HTTP Status Codes table for all possible values. |
errorMessage | string | A descriptive message explaining the error. |
tip
- Use the information provided in the
errorMessage
field to understand what went wrong and how to correct it. - If you are unable to resolve the issue, consider reaching out to the support team with the error details for further assistance.