Skip to content

Instantly share code, notes, and snippets.

View jordanorelli's full-sized avatar
👾

Jordan Orelli jordanorelli

👾
View GitHub Profile
begin
response = call_api # this might throw X
response.save_to_db # this might throw Y
rescue X
# handle the error with calling the api
rescue Y
# handle the error with saving to the database
rescue Exception => e
# handles *any* exception; maybe you got the exception type wrong?
end