Skip to content

Commit

Permalink
Fix omfg() in HandleErroredBillingBatch (#295)
Browse files Browse the repository at this point in the history
With the changes we made in [Better handle errors in Notifiers](#273) calls to `omfg()` should pass the error separately from any data to be included.

Whilst working on the code we spotted an instance we'd overlooked when updating all our `omfg()` calls.
  • Loading branch information
Cruikshanks authored Jul 6, 2023
1 parent 0002535 commit 8960140
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const BillingBatchModel = require('../../models/water/billing-batch.model.js')
* We keep this in a separate service so we don't need to worry about multiple/nested try-catch blocks in cases where a
* billing batch fails and setting its status to error also fails.
*
* Note that although this is async we would generally not call it asyncronously as the intent is you can call it and
* Note that although this is async we would generally not call it asynchronously as the intent is you can call it and
* continue with whatever error logging is required
*
* @param {String} billingBatchId UUID of the billing batch to be marked with `error` status
Expand All @@ -23,7 +23,7 @@ async function go (billingBatchId, errorCode = null) {
try {
await _updateBillingBatch(billingBatchId, errorCode)
} catch (error) {
global.GlobalNotifier.omfg('Failed to set error status on billing batch', { error, billingBatchId, errorCode })
global.GlobalNotifier.omfg('Failed to set error status on billing batch', { billingBatchId, errorCode }, error)
}
}

Expand Down

0 comments on commit 8960140

Please sign in to comment.