@@ -119,15 +119,22 @@ In the above case, @document and @person would be made available to the email
119
119
renderer, allowing your new section(s) to access and display them. See the
120
120
existing sections defined by the plugin for examples of how to write your own.
121
121
122
- == Advanced Customization
122
+ == 404s errors
123
123
124
- By default, the email notifier will only notify on critical errors. For
125
- ActiveRecord::RecordNotFound and ActionController::UnknownAction, it will
126
- simply render the contents of your public/404.html file. Other exceptions
127
- will render public/500.html and will send the email notification. If you want
128
- to use different rules for the notification, you will need to implement your
129
- own rescue_action_in_public method. You can look at the default implementation
130
- in ExceptionNotifiable for an example of how to go about that.
124
+ Notification is skipped if you return a 404 status, which happens by default
125
+ for an ActiveRecord::RecordNotFound or ActionController::UnknownAction error.
131
126
127
+ == Manually notifying of error in a rescue block
128
+
129
+ If your controller action manually handles an error, the notifier will never be
130
+ run. To manually notify of an error call notify_about_exception from within the
131
+ rescue block
132
+
133
+ def index
134
+ #risky operation here
135
+ rescue StandardError => error
136
+ #custom error handling here
137
+ notify_about_exception(error)
138
+ end
132
139
133
140
Copyright (c) 2005 Jamis Buck, released under the MIT license
0 commit comments