User Tools

Site Tools


version_1.0_customerror

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

version_1.0_customerror [2019/09/10 10:38] (current)
timsmith created
Line 1: Line 1:
 +====== Custom Error (Version 1.0)======
 +
 +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/​version/​1.0/​customerror^
 +
 +^NOTE: Be sure to include the key parameter with your call see [[api_keys]]^
 +                                                                         
 +===== Returns =====
 +
 +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|
 +
 +=== Additional Headers ===
 +^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|
  
version_1.0_customerror.txt ยท Last modified: 2019/09/10 10:38 by timsmith