Skip to content

Instantly share code, notes, and snippets.

@rfunduk
Forked from shime/example_controller.rb
Created February 17, 2012 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfunduk/1853426 to your computer and use it in GitHub Desktop.
Save rfunduk/1853426 to your computer and use it in GitHub Desktop.
sending errors to Exceptional with rescue_from
class ExampleController < ApplicationController
rescue_from Exception, :with => :render_custom
def render_custom(exception)
if Exceptional::Remote.error(Exceptional::ExceptionData.new(exception, "Test Exception"))
Rails.logger.info "Exceptional: #{exception.class} has been reported to Exceptional"
else
Rails.logger.error "Exceptional: Problem sending exception. Check your API key."
end
render :text => "A custom error page"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment