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
174
174
# Given an exception object, hands off the needed parameters to
175
175
# the Failure module.
176
176
def fail ( exception )
177
- run_failure_hooks ( exception )
177
+ run_failure_hooks ( exception ) rescue nil
178
178
Failure . create \
179
179
:payload => payload ,
180
180
:exception => exception ,
Original file line number Diff line number Diff line change 28
28
assert_equal ( 'Extra Bad job!' , Resque ::Failure . all [ 'error' ] )
29
29
end
30
30
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
+
31
39
it "does not allow exceptions from failure backend to escape" do
32
40
job = Resque ::Job . new ( :jobs , { } )
33
41
with_failure_backend BadFailureBackend do
You can’t perform that action at this time.
0 commit comments