Skip to content

Commit

Permalink
chore(logs): improve/fix logs
Browse files Browse the repository at this point in the history
  • Loading branch information
yossi-eynav committed Apr 17, 2024
1 parent ec776ef commit 6ccf752
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/api/model/plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class Plan extends Model {
try {
await existingFile.destroy({ transacting: transaction });
} catch (e) {
Log.error(`error destroy file: ${e.message}`, e.trace());
Log.error({message: 'error destroy file', error: e});
}
}

Expand All @@ -438,7 +438,7 @@ class Plan extends Model {
const chartRows = await modelClass.query(qb => {
qb.where('plan_id', plan.id);
}).fetchAll({ transacting: transaction }).catch(e => {
Log.error(`error fetch plan ${plan.id} chart: ${e.message}`, e.trace());
Log.error({ message: `error fetch plan`, error: e, planId: plan.id });
});

for (const chartModel of chartRows.models) {
Expand Down Expand Up @@ -515,12 +515,12 @@ class Plan extends Model {
}
}
} catch (e) {
Log.error(`error setMavatData tx for plan: ${e.message}`, e.trace());
Log.error({ message: 'error setMavatData tx for plan', error: e });
}

});
} catch (e) {
Log.error(`error setMavatData for plan: ${e.message}`, e.trace());
Log.error({ message: `error setMavatData for plan`, error: e });
}

return plan;
Expand Down

0 comments on commit 6ccf752

Please sign in to comment.