adam-paterson / ibm-watson-sdk

🛠 [WIP] The unofficial Watson PHP SDK enables developers to quickly add Watson Cognitive Computing services to their PHP applications.
https://www.ibm.com/watson/
6 stars 1 forks source link

Update HTTP exceptions #17

Open adam-paterson opened 7 years ago

adam-paterson commented 7 years ago

We need to replace the Http\Client\Exception\HttpException in IBM\Watson\Core\Client\ExceptionHandler:handle with a more specific exception.

Watson error responses are usually in the format:

{
  "error": "General description of an error.",
  "errors": [
    {
      "message": "Description of a specific constraint violation.",
      "path": "The location of the constraint violation."
    }
  ],
  "code": 500
}