From 6ccf752dab7271a40f3f7b0db7716af6b999198f Mon Sep 17 00:00:00 2001 From: Yossi Eynav Date: Wed, 17 Apr 2024 11:22:15 +0300 Subject: [PATCH] chore(logs): improve/fix logs --- server/api/model/plan.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/api/model/plan.js b/server/api/model/plan.js index 965d986c8..052a93e25 100644 --- a/server/api/model/plan.js +++ b/server/api/model/plan.js @@ -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}); } } @@ -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) { @@ -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;