Module: Mihari::Mixins::ErrorNotification

Included in:
Commands::Search, Mihari::Middleware::ErrorNotificationAdapter
Defined in:
lib/mihari/mixins/error_notification.rb

Instance Method Summary collapse

Instance Method Details

#with_error_notificationNil

Send an exception notification if there is any error in a block

Returns:

  • (Nil)


11
12
13
14
15
16
17
# File 'lib/mihari/mixins/error_notification.rb', line 11

def with_error_notification
  yield
rescue StandardError => e
  Mihari.logger.error e

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