Skip to content

Commit

Permalink
feat: enrich sentry error logging
Browse files Browse the repository at this point in the history
store invalid import files for later debugging
  • Loading branch information
janz93 committed Feb 11, 2025
1 parent 3d36436 commit 95a648c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions box/jobs/fetch_upcoming_statements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def fetch_for_account(account)
rescue Sequel::NoMatchingRow => _ex
Box.logger.error("[Jobs::FetchUpcomingStatements] Could not find Account ##{account.id}")
rescue Epics::Error::BusinessError => ex
if ENV["SENTRY_DSN"]
Sentry.add_attachment(filename: "#{account.id}_vmk_mt942_#{SecureRandom.uuid}", bytes: vmk_data) if !vmk_data.empty?
Sentry.capture_exception(ex)
end
# The BusinessError can occur when no new statements are available
Box.logger.error("[Jobs::FetchUpcomingStatements] EBICS error. id=#{account.id} reason='#{ex.message}'")
end
Expand Down

0 comments on commit 95a648c

Please sign in to comment.