refactor(puchase): changes how the error handling works so a better email can be sent

This commit is contained in:
2026-04-10 13:58:30 -05:00
parent c9eb59e2ad
commit 9d39c13510
3 changed files with 25 additions and 14 deletions

View File

@@ -39,8 +39,8 @@ export const monitorAlplaPurchase = async () => {
module: "purchase",
subModule: "query",
message: `Error getting alpla purchase info`,
data: [sqlQuery.message],
notify: false,
data: sqlQuery.message as any,
notify: true,
});
}
@@ -78,7 +78,7 @@ export const monitorAlplaPurchase = async () => {
if (error) {
log.error(
{ error },
{ error, notify: true },
"There was an error adding alpla purchase history",
);
}
@@ -86,8 +86,10 @@ export const monitorAlplaPurchase = async () => {
await delay(500);
}
} catch (e) {
log.error({ error: e }, "Error occurred while running the monitor job");
log.error({ error: e }, "Error occurred while running the monitor job");
log.error(
{ error: e, notify: true },
"Error occurred while running the monitor job",
);
return;
}
@@ -104,7 +106,7 @@ export const monitorAlplaPurchase = async () => {
// if theres no reqs just end meow
if (errorReq) {
log.error(
{ stack: errorReq },
{ stack: errorReq, notify: true },
"There was an error getting history data",
);
return;