consilience / openapi-generator-psr18

Templates to generate a PSR-18/PSR-17/PSR-7 client package for PHP
Apache License 2.0
2 stars 0 forks source link

Do not throw exception on all non-2xx responses #6

Open judgej opened 5 years ago

judgej commented 5 years ago

The client will thrown an exception on all response codes outside the range 200 to 299. Sometimes an error, such as a bad request 401 is returned with a payload, which may include validation errors or other diagnostics. These error details are lost when an exception is thrown.

This may be a misunderstanding on my part wrt HTTP responses, which I will look into.

judgej commented 5 years ago

i.e. only throw an exception if there is no handler for the specific error in the range 400 to 599.