Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new exception on unexpected response #339

Closed
Art4 opened this issue Dec 21, 2023 · 0 comments · Fixed by #340
Closed

Add new exception on unexpected response #339

Art4 opened this issue Dec 21, 2023 · 0 comments · Fixed by #340
Milestone

Comments

@Art4
Copy link
Collaborator

Art4 commented Dec 21, 2023

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.

@Art4 Art4 added this to the v2.4.0 milestone Dec 21, 2023
@Art4 Art4 closed this as completed in #340 Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant