Add new exception on unexpected response
Art4 opened this issue · comments
Artur Weigandt commented
In #329 we introduced the new list()
methods. Theses methods always return an array.
It is possible that the Redmine server responses with an unexpected body, e.g. because a parameter was set incorrectly (see #335). In this case the parsing of the body will fail, causing a SerializerException. This results in a bad DX as the developer has no clue why the parsing of the body fails.
We should catch this exceptions in the list()
methods and re-throw them with a more meaningful exception. I propose a new UnexpectedResponseException
or a more general ResponseException
.