Skip to content

Instantly share code, notes, and snippets.

@paul
Created September 30, 2008 18:18
Show Gist options
  • Save paul/13904 to your computer and use it in GitHub Desktop.
Save paul/13904 to your computer and use it in GitHub Desktop.
class Answers < Application
provides :sscj1
...
def show
raise "Oh noes!"
@answer = answer
display @answer
end
...
end
class Exceptions < Application
provides :sscj1
# handle NotFound exceptions (404)
def not_found
render
end
# handle NotAcceptable exceptions (406)
def not_acceptable
render
end
def internal_server_error
render
end
end
{
"_type": "InternalServerError",
"name": <%= j @exception_name %>,
"parameters": <%= j params[:original_params] %>,
<% if ::Merb::Config[:exception_details] %>
"message": <%= j @exception.message %>,
"backtrace": <%= j @exception.backtrace %>,
<% end %>
"request_uri": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment