From 89601405d64c81b740537c0c5dc409a0d6f8e3e5 Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Thu, 6 Jul 2023 16:46:49 +0100 Subject: [PATCH] Fix omfg() in HandleErroredBillingBatch (#295) With the changes we made in [Better handle errors in Notifiers](https://github.com/DEFRA/water-abstraction-system/pull/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. --- .../handle-errored-billing-batch.service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/supplementary-billing/handle-errored-billing-batch.service.js b/app/services/supplementary-billing/handle-errored-billing-batch.service.js index b481f1a3ce..e9f9cb4644 100644 --- a/app/services/supplementary-billing/handle-errored-billing-batch.service.js +++ b/app/services/supplementary-billing/handle-errored-billing-batch.service.js @@ -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 @@ -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) } }