File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def args
174174 # Given an exception object, hands off the needed parameters to
175175 # the Failure module.
176176 def fail ( exception )
177- run_failure_hooks ( exception )
177+ run_failure_hooks ( exception ) rescue nil
178178 Failure . create \
179179 :payload => payload ,
180180 :exception => exception ,
Original file line number Diff line number Diff line change 2828 assert_equal ( 'Extra Bad job!' , Resque ::Failure . all [ 'error' ] )
2929 end
3030
31+ it "unavailable job definition reports exception and message" do
32+ Resque ::Job . create ( :jobs , 'NoJobDefinition' )
33+ @worker . work ( 0 )
34+ assert_equal 1 , Resque ::Failure . count , 'failure not reported'
35+ assert_equal ( 'NameError' , Resque ::Failure . all [ 'exception' ] )
36+ assert_equal ( 'uninitialized constant NoJobDefinition' , Resque ::Failure . all [ 'error' ] )
37+ end
38+
3139 it "does not allow exceptions from failure backend to escape" do
3240 job = Resque ::Job . new ( :jobs , { } )
3341 with_failure_backend BadFailureBackend do
You can’t perform that action at this time.
0 commit comments