Sha256: 77970c207e2624fbe4922891d0c537101d1364da95a97271373c00cf425c24a9

Contents?: true

Size: 419 Bytes

Versions: 2

Compression:

Stored size: 419 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Mixins
    #
    # Error notification mixin
    #
    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

2 entries across 2 versions & 1 rubygems

Version Path
mihari-5.7.1 lib/mihari/mixins/error_notification.rb
mihari-5.7.0 lib/mihari/mixins/error_notification.rb