This module are raised when an exception fire up in controllers.
Now you can personalize exception and simplify the layout using templates in:
app/views/exception
when an exception is raised it try to send an email, and for send an email you need to configure in enviroment or in an initializer some like this:
Examples:
Lipsiadmin::Mailer::ExceptionNotifier.sender_address = %("Exception Notifier" <server1@lipsiasoft.com>)
Lipsiadmin::Mailer::ExceptionNotifier.recipients_addresses = %(info@lipsiasoft.com)
Lipsiadmin::Mailer::ExceptionNotifier.email_prefix = "[Your Project]"
Methods
Public Instance methods
Overwrite to implement public exception handling (for requests answering false to local_request?). By default will call render_optional_error_file. Override this method to provide more user friendly error messages.
[ show source ]
# File lib/controller/rescue.rb, line 28
28: def rescue_action_in_public_with_notifier(exception) #:doc:
29: response_code = response_code_for_rescue(exception)
30: status = interpret_status(response_code)[0,3]
31: respond_to do |format|
32: # Personalize rescue rules for backend
33: if controller_path =~ /^backend\//
34: # Usually when we made a post we submit the form
35: # to a target iframe, so we need to respond to the parent.
36: if request.post?
37: responds_to_parent do
38: render :update do |page|
39: page.unmask
40: page.ext_alert I18n.t("lipsiadmin.exceptions.#{status}.title"), I18n.t("lipsiadmin.exceptions.#{status}.description")
41: end
42: end
43: else
44: # We can't use status, because Backend.app.load don't permit load 500, 404 pages
45: format.html { render :template => "/exceptions/#{status}" }
46: format.js do
47: render :update do |page|
48: page.unmask
49: page.ext_alert I18n.t("lipsiadmin.exceptions.#{status}.title"), I18n.t("lipsiadmin.exceptions.#{status}.description")
50: end
51: end
52: format.all { render :nothing => true, :status => status }
53: end
54: else
55: format.html { render :template => "/exceptions/#{status}", :status => status }
56: format.all { render :nothing => true, :status => status }
57: end
58: end
59: rescue Exception => e
60: logger.error e.message
61: erase_results
62: rescue_action_in_public_without_notifier(exception)
63: ensure
64: if response_code != :not_found && Lipsiadmin::Mailer::ExceptionNotifier.send_mail
65: Lipsiadmin::Mailer::ExceptionNotifier.deliver_exception(exception, self, request)
66: end
67: end