Permalink
Browse files

Updated notifier documentation on manually sending notifications

  • Loading branch information...
1 parent 4916703 commit 8d69e4a980815722a48921486604143dedd2fbdc Joe Ferris committed Nov 24, 2009
Showing with 10 additions and 12 deletions.
  1. +10 −12 README.rdoc
View
@@ -109,29 +109,27 @@ You can also pass a hash to notify_hoptoad method and store whatever you want, n
my_unpredicable_method(params)
rescue => e
HoptoadNotifier.notify(
- :error_class => "Special Error",
+ :error_class => "Special Error",
:error_message => "Special Error: #{e.message}",
- :request => { :params => params }
+ :parameters => params
)
end
While in your controllers you use the notify_hoptoad method, anywhere else in your code, use HoptoadNotifier.notify. Hoptoad will get all the information about the error itself. As for a hash, these are the keys you should pass:
* :error_class – Use this to group similar errors together. When Hoptoad catches an exception it sends the class name of that exception object.
* :error_message – This is the title of the error you see in the errors list. For exceptions it is "#{exception.class.name}: #{exception.message}"
-* :request – While there are several ways to send additional data to Hoptoad, passing a Hash with :params key as :request as in the example above is the most common use case. When Hoptoad catches an exception in a controller, the actual HTTP client request is being sent using this key.
+* :parameters – While there are several ways to send additional data to Hoptoad, passing a Hash as :parameters as in the example above is the most common use case. When Hoptoad catches an exception in a controller, the actual HTTP client request parameters are sent using this key.
Hoptoad merges the hash you pass with these default options:
- def default_notice_options
- {
- :api_key => HoptoadNotifier.api_key,
- :error_message => 'Notification',
- :backtrace => caller,
- :request => {},
- :session => {}
- }
- end
+ {
+ :api_key => HoptoadNotifier.api_key,
+ :error_message => 'Notification',
+ :backtrace => caller,
+ :parameters => {},
+ :session => {}
+ }
You can override any of those parameters.

0 comments on commit 8d69e4a

Please sign in to comment.