GitHub.jl icon indicating copy to clipboard operation
GitHub.jl copied to clipboard

Error type

Open frankier opened this issue 2 years ago • 1 comments
trafficstars

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.

frankier avatar Aug 24 '23 09:08 frankier

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

KristofferC avatar Aug 24 '23 12:08 KristofferC