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.
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:But since there is no error type and
error(...)is used instead we just get anErrorExceptionand we would have to parse back out the error code if we wanted it.