refactor(puchase): changes how the error handling works so a better email can be sent
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user