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 Error.Is interface method on the custom error type APIError. #162

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oldztimer
Copy link

This method supports doing "errors.Is" checks so downstream can handle API errors more specifically.

In my case, since I copied your lazyClient example, but I'm using it in a server, the Login needs to be refreshed if an API call errors out with "api.err.LoginRequired". There was no clean way to check for this specific error in order to refresh the login and retry.

This method supports doing "errors.Is" checks so downstream can handle API errors more specifically.

In my case, since I copied your lazyClient example, but I'm using it in a server, the Login needs to be refreshed if an API call errors out with "api.err.LoginRequired".
There was no clean way to check for this specific error in order to refresh the login and retry.
@oldztimer
Copy link
Author

@paultyng Hoping you'd be interested in the PR to support clients processing API errors.

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

Successfully merging this pull request may close these issues.

1 participant