Method: BGS::Exceptions::BGSErrors#log_oracle_errors!

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

#log_oracle_errors!(error:) ⇒ Object (private)

BGS sometimes returns errors containing an enormous stacktrace with an oracle error. This method logs the oracle error message and excludes everything else. These oracle errors start with the signature ‘ORA-` and are bookended by a `prepstmnt` clause. See `spec/fixtures/bgs/bgs_oracle_error.txt` for an example. We want to log these errors separately because the original error message is so long that it obscures its only relevant information and actually breaks Sentry’s UI.



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/bgs/exceptions/bgs_errors.rb', line 53

def log_oracle_errors!(error:)
  oracle_error_match_data = error.message.match(/ORA-.+?(?=\s*{prepstmnt)/m)
  if oracle_error_match_data&.length&.positive?
    log_message_to_sentry(
      oracle_error_match_data[0],
      :error,
      { icn: @user[:icn] },
      { team: 'vfs-ebenefits' }
    )
  end
end