Skip to content

Commit 24feff3

Browse files
committed
Add README section explaining how to manually notify about an exception.
1 parent ca04882 commit 24feff3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ In the above case, @document and @person would be made available to the email
7070
renderer, allowing your new section(s) to access and display them. See the
7171
existing sections defined by the plugin for examples of how to write your own.
7272

73+
Manually notify of exception
74+
---
75+
76+
If your controller action manually handles an error, the notifier will never be
77+
run. To manually notify of an error you can do something like the following:
78+
79+
rescue_from Exception, :with => :server_error
80+
81+
def server_error(exception)
82+
# Whatever code that handles the exception
83+
84+
ExceptionNotifier::Notifier.exception_notification(request.env, exception).deliver
85+
end
86+
7387
Notification
7488
---
7589

0 commit comments

Comments
 (0)