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

Error type #216

Open
frankier opened this issue Aug 24, 2023 · 1 comment
Open

Error type #216

frankier opened this issue Aug 24, 2023 · 1 comment

Comments

@frankier
Copy link

Currently errors are thrown as strings using error. This makes handling a bit annoying. It may be that if there is a 404 error, this is considered useful information (i.e. the corresponding object does not exist). When handling the error the user would then want to do:

try
    GitHub.something(...)
catch e
    if e.status == 404
        do_something()
    else
        throw e
    end
end

But since there is no error type and error(...) is used instead we just get an ErrorException and we would have to parse back out the error code if we wanted it.

@KristofferC
Copy link
Collaborator

PRs improving the error handling in the package would be very welcome indeed!

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

2 participants