Skip to content

Commit 95a648c

Browse files
committed
feat: enrich sentry error logging
store invalid import files for later debugging
1 parent 3d36436 commit 95a648c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

box/jobs/fetch_upcoming_statements.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def fetch_for_account(account)
4848
rescue Sequel::NoMatchingRow => _ex
4949
Box.logger.error("[Jobs::FetchUpcomingStatements] Could not find Account ##{account.id}")
5050
rescue Epics::Error::BusinessError => ex
51+
if ENV["SENTRY_DSN"]
52+
Sentry.add_attachment(filename: "#{account.id}_vmk_mt942_#{SecureRandom.uuid}", bytes: vmk_data) if !vmk_data.empty?
53+
Sentry.capture_exception(ex)
54+
end
5155
# The BusinessError can occur when no new statements are available
5256
Box.logger.error("[Jobs::FetchUpcomingStatements] EBICS error. id=#{account.id} reason='#{ex.message}'")
5357
end

0 commit comments

Comments
 (0)