Custom Error
From time to time, you may encounter an error in one of the PSL API calls. In order to design software that is user-friendly and consistent, you will want to write code that handles errors from the API elegantly. To better help you handle errors, the Custom Error call allows you to generate an error with an http response code of 500 with additional details provided in the Response Headers.
NOTE: Be sure to include the key parameter with your call see api_keys |
The method will return an HTTP Response Code of 500 (Internal Server Error) along with a JSON object that contains some basic information about the error. Additionally, you will find additional Response Headers that provide error details.
JSON Response
Name | Value | Notes |
AuthenticationStatus | authenticated | this field will indicate whether or not your api key was present and accepted |
ErrorCode | 40 | the internal error code used by us to further diagnose the issue (NOTE: not all errors have an error code) |
ErrorMessage | Custom Error Test | our user-friendly description of the error |
Name | Value | Notes |
BIZ-ERROR | Custom Biz Error | a more detailed description of what went wrong in our business logic (useful when reporting any recurring bugs to us). NOTE: these errors are not user-friendly and should not be reported directly to an end user. |
PLEX-ERROR-CODE | 40 | the internal error code used by us to further diagnose the issue (NOTE: not all errors have an error code) |
PLEX-ERROR | Custom Error Test | our user-friendly description of the error |