Created
February 16, 2012 17:52
-
-
Save shime/1846719 to your computer and use it in GitHub Desktop.
sending errors to Exceptional with rescue_from
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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