Created
September 28, 2017 20:52
-
-
Save martinstreicher/98ae3a3b4514856ec4ffd70b07487bc7 to your computer and use it in GitHub Desktop.
Revisions
-
martinstreicher renamed this gist
Sep 28, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
martinstreicher created this gist
Sep 28, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ module Middleware SquelchedException = Class.new Exception class SidekiqExceptionHandler def call(worker, job, queue) yield rescue Exception => exception notify exception, job, ignore: ignore_exception?(exception) raise SquelchedException end private def ignore_exception?(exception) Bugsnag.configuration.ignore_classes.include?(exception.class.name) end def notify(exception, job, ignore: false) args = job['args'].inject { |result, hash| result.merge hash } ExceptionLoggingService.log(exception, args: args, ignore: ignore) end end end