Skip to content

Instantly share code, notes, and snippets.

@shime
Created February 16, 2012 17:52
Show Gist options
  • Save shime/1846719 to your computer and use it in GitHub Desktop.
Save shime/1846719 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