Skip to content

Instantly share code, notes, and snippets.

@paul
Created September 30, 2008 21:09
Show Gist options
  • Save paul/13960 to your computer and use it in GitHub Desktop.
Save paul/13960 to your computer and use it in GitHub Desktop.
class Exceptions < Application
provides :sscj1
# handle NotFound exceptions (404)
def not_found
if content_type == :sscj1
standard_error
Merb.logger.info _template_for(:standard_error, :sscj1, controller_name, nil).inspect
render :standard_error
else
render
end
end
# handle NotAcceptable exceptions (406)
def not_acceptable
render :standard_error if content_type == :sscj1
#render
end
# Everything else (500)
def standard_error
@exceptions = request.exceptions
@show_details = Merb::Config[:exception_details]
render
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment