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

Removal of ResponseErrorHandler #62

Open
k9withabone opened this issue Mar 2, 2023 · 0 comments
Open

Removal of ResponseErrorHandler #62

k9withabone opened this issue Mar 2, 2023 · 0 comments

Comments

@k9withabone
Copy link
Contributor

I'm thinking about removing ResponseErrorHandler and it's corresponding function arguments that are in every endpoint, stemming from AudiobookshelfApi.requestJson(). This would also make the return types of those functions non-nullable.
The original idea of ResponseErrorHandler was to provide a place where the caller could have access to the original http.Response when doing JSON conversion and something went wrong. An alternative solution for this is to catch all throws from fromJson(), wrap it in a new error type that also includes the http.Response, and throw that.

@keaganhilliard, I would like your thoughts on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant