Skip to content

Instantly share code, notes, and snippets.

@bk2204
Created June 25, 2014 02:15
Show Gist options
  • Select an option

  • Save bk2204/8f93b8442e477af1f454 to your computer and use it in GitHub Desktop.

Select an option

Save bk2204/8f93b8442e477af1f454 to your computer and use it in GitHub Desktop.
def main
something_that_might_explode_violently
rescue YourError => error
case
when error.status == 404
search
when error.on_fire
FireDepartment.call(type: :emergency)
when error.status_code == 500
shame caller(1)
end
raise
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment