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

Fix missing HTTP response return in PastedAccount method. #23

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

wneessen
Copy link
Owner

Fixes #22

  • In case of a HTTP error the PastedAccount method is supposed to return the HTTP response, since this can hold valuable information about the reason why the request failed. Instead, it was returning nil. This PR fixes this behaviour.
  • Additionally, this PR introduces tests to catch such oversights
  • Finally a proper error.New() error has been introduces, to that error.Is() can be used on common error that are detected by the module

Fixes #22

- In case of a HTTP error the PastedAccount method is supposed to return the HTTP response, since this can hold valuable information about the reason why the request failed. Instead, it was returning `nil`. This PR fixes this behaviour.
- Additionally, this PR introduces tests to catch such oversights
- Finally a proper `error.New()` error has been introduces, to that `error.Is()` can be used on common error that are detected by the module
@wneessen wneessen linked an issue Dec 22, 2022 that may be closed by this pull request
@wneessen wneessen merged commit ec5038a into main Dec 22, 2022
@wneessen wneessen deleted the fix/22-should-return-httpresponse-for-paste branch December 22, 2022 09:02
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.

Should return http.Response for paste?
1 participant