Method: BGS::Exceptions::BGSErrors#notify_of_service_exception

Defined in:
lib/bgs/exceptions/bgs_errors.rb

#notify_of_service_exception(error, method, attempt = nil, status = :error) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bgs/exceptions/bgs_errors.rb', line 23

def notify_of_service_exception(error, method, attempt = nil, status = :error)
  msg = "Unable to #{method}: #{error.message}: try #{attempt} of #{MAX_ATTEMPTS}"
  context = { icn: @user[:icn] }
  tags = { team: 'vfs-ebenefits' }

  return log_message_to_sentry(msg, :warn, context, tags) if status == :warn

  log_oracle_errors!(error:)
  log_exception_to_sentry(error, context, tags)
  raise_backend_exception('BGS_686c_SERVICE_403', self.class, error)
end