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

Errorhandling when not premium #15

Closed
semla opened this issue Feb 4, 2021 · 3 comments
Closed

Errorhandling when not premium #15

semla opened this issue Feb 4, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@semla
Copy link
Contributor

semla commented Feb 4, 2021

I am getting errors because I am not premium.
Screenshot from 2021-02-04 09-23-48

I can add error-handling. I imagine the api provides some info if the user is prem or not. So could either check that before making the request. Or handle the error after the request. I suggest the latter (handling the error). Easier to get started with and probably good to get add some error-handling in the services anyways?
What do you think?

@mathkruger
Copy link
Owner

Yeah, that error handling was on my plans, we just need to map all the endpoints that require premium account. Maybe we can do both, prevent the actions that require premium (for free accounts) and handling the error in the services.

@mathkruger mathkruger added the bug Something isn't working label Feb 4, 2021
@semla
Copy link
Contributor Author

semla commented Feb 4, 2021

Ok, sounds reasonable. Regarding the services, what do you think about catching the error in the ServiceBase. And then if it is something that should be shown to the user, rethrow, and catch that error in the calling service? Or in cases where it makes sense, retry the request.
With this error I guess there is no point in rethrowing the error, so just handle it in the base-service and return.. null or an empty?

@mathkruger
Copy link
Owner

Sounds good! Just handle it and return null, but keeping the status code, so we know what went wrong in the services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants