We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07f49f9 commit 5ba33f5Copy full SHA for 5ba33f5
lib/resque/job.rb
@@ -166,6 +166,13 @@ def payload_class
166
@payload_class ||= constantize(@payload['class'])
167
end
168
169
+ # returns true if payload_class does not raise NameError
170
+ def has_payload_class?
171
+ payload_class != Object
172
+ rescue NameError
173
+ false
174
+ end
175
+
176
# Returns an array of args represented in this job's payload.
177
def args
178
@payload['args']
@@ -174,7 +181,7 @@ def args
181
# Given an exception object, hands off the needed parameters to
182
# the Failure module.
183
def fail(exception)
- run_failure_hooks(exception) rescue nil
184
+ run_failure_hooks(exception) if has_payload_class?
185
Failure.create \
179
186
:payload => payload,
180
187
:exception => exception,
0 commit comments