User Tools

Site Tools


customerror

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.

customerror GET Service at https://nyc.electionapi.com/psl/customerror
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

NameValueNotes
AuthenticationStatusauthenticatedthis field will indicate whether or not your api key was present and accepted
ErrorCode40the internal error code used by us to further diagnose the issue (NOTE: not all errors have an error code)
ErrorMessageCustom Error Testour user-friendly description of the error

Additional Headers

NameValueNotes
BIZ-ERRORCustom Biz Errora 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-CODE40the internal error code used by us to further diagnose the issue (NOTE: not all errors have an error code)
PLEX-ERRORCustom Error Testour user-friendly description of the error
customerror.txt · Last modified: 2016/01/28 08:19 (external edit)