Throw exceptions instead of the ugly Result monad #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #12, ref #22
I cherry-picked c6bbc7b and it seems to have not bitrotted. In case it's not obvious, this is totally breaking (but consistently so, so updates shouldn't be very difficult).
The gist is: instead of receiving a
Result{T}
that contains aT
(repo, user, PR, etc.), an HTTP response, and exception info, we get back aTuple{T, Response}
. If an exception was thrown in the request, it's thrown to the user too, they can catch it like any other error-handling situation. There'sHTTPError
is anything that was thrown fromHTTP.request
,PostProcessorError
which generally comes from parsing, andRateLimitedError
, which is not new.Code changes might look like:
IMO it just makes a lot more intuitive sense.
TODO: need to update CI to GHA, update Documenter setup and manifest, bump minor version.