Skip to content

Commit

Permalink
Rescue NoMethodError to prevent requeueing something that won't work
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunne committed Sep 25, 2018
1 parent 0af8deb commit 7d61e01
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/models/mixins/process_tasks_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,20 @@ def invoke_api_tasks(api_client, remote_options)
_log.error(err.message)
else
_log.info("Invoking task #{action} on collection #{collection_name}, object #{obj.id}, with args #{post_args}")
obj.send(action, post_args)
begin
obj.send(action, post_args)
rescue NoMethodError => err
_log.error(err.message)
end
end
end
else
_log.info("Invoking task #{action} on collection #{collection_name}, with args #{post_args}")
collection.send(action, post_args)
begin
collection.send(action, post_args)
rescue NoMethodError => err
_log.error(err.message)
end
end
end

Expand Down

0 comments on commit 7d61e01

Please sign in to comment.