public
Description: Reports exceptions to Hoptoad
Homepage: http://www.hoptoadapp.com/
Clone URL: git://github.com/thoughtbot/hoptoad_notifier.git
Changed the rake task so it can report different errors for testing 
purposes.
jyurek (author)
Tue Aug 05 14:32:21 -0700 2008
commit  f4dcf5ed5ad63a4372921342c451d843a8070044
tree    a10c8ea59f6c0113e213402c641e4df7017a8152
parent  f2d4f03a891dcb8f7d848ad7b31fa4d8112ff15f
...
19
20
21
22
23
 
 
24
25
26
...
33
34
35
 
 
 
 
 
 
 
36
37
38
...
19
20
21
 
 
22
23
24
25
26
...
33
34
35
36
37
38
39
40
41
42
43
44
45
0
@@ -19,8 +19,8 @@ namespace :hoptoad do
0
       # This is to bypass any filters that may prevent access to the action.
0
       prepend_before_filter :test_hoptoad
0
       def test_hoptoad
0
- puts 'Raising an error to simulate application failure.'
0
- raise HoptoadTestingException, 'Testing hoptoad via "rake hoptoad:test". If you can see this, it works.'
0
+ puts "Raising '#{exception_class.name}' to simulate application failure."
0
+ raise exception_class.new, 'Testing hoptoad via "rake hoptoad:test". If you can see this, it works.'
0
       end
0
 
0
       def rescue_action exception
0
@@ -33,6 +33,13 @@ namespace :hoptoad do
0
 
0
       # Ensure we actually have an action to go to.
0
       def verify; end
0
+
0
+ def exception_class
0
+ exception_name = ENV['EXCEPTION'] || "HoptoadTestingException"
0
+ Object.const_get(exception_name)
0
+ rescue
0
+ Object.const_set(exception_name, Class.new(Exception))
0
+ end
0
     end
0
 
0
     puts 'Processing request.'

Comments

    No one has commented yet.