Sha256: 8685cf07926039afa1ab5deed0e67d6197fb92b2fe0b97c469e0ba2cf8957858

Contents?: true

Size: 376 Bytes

Versions: 20

Compression:

Stored size: 376 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Mixins
    module ErrorNotification
      #
      # Send an exception notification if there is any error in a block
      #
      def with_error_notification
        yield
      rescue StandardError => e
        Mihari.logger.error e

        Sentry.capture_exception(e) if Sentry.initialized?
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mihari-5.6.2 lib/mihari/mixins/error_notification.rb
mihari-5.6.1 lib/mihari/mixins/error_notification.rb
mihari-5.6.0 lib/mihari/mixins/error_notification.rb
mihari-5.5.0 lib/mihari/mixins/error_notification.rb
mihari-5.4.9 lib/mihari/mixins/error_notification.rb
mihari-5.4.8 lib/mihari/mixins/error_notification.rb
mihari-5.4.7 lib/mihari/mixins/error_notification.rb
mihari-5.4.6 lib/mihari/mixins/error_notification.rb
mihari-5.4.5 lib/mihari/mixins/error_notification.rb
mihari-5.4.4 lib/mihari/mixins/error_notification.rb
mihari-5.4.3 lib/mihari/mixins/error_notification.rb
mihari-5.4.2 lib/mihari/mixins/error_notification.rb
mihari-5.4.1 lib/mihari/mixins/error_notification.rb
mihari-5.4.0 lib/mihari/mixins/error_notification.rb
mihari-5.3.2 lib/mihari/mixins/error_notification.rb
mihari-5.3.1 lib/mihari/mixins/error_notification.rb
mihari-5.3.0 lib/mihari/mixins/error_notification.rb
mihari-5.2.4 lib/mihari/mixins/error_notification.rb
mihari-5.2.3 lib/mihari/mixins/error_notification.rb
mihari-5.2.2 lib/mihari/mixins/error_notification.rb