Skip to content

Commit

Permalink
chore: log errors always
Browse files Browse the repository at this point in the history
  • Loading branch information
michalstruck committed Nov 25, 2024
1 parent 8d40836 commit 7a5249b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,10 @@ export const getAccumulativeTransactionData = async (
accumulatedTokenAmountUSD: roundToTwoDecimals(accumulatedTokenAmountUSD),
};
} catch (error) {
if (error instanceof Error) {
logger.warn("Error fetching transaction data", {
errorName: error.name,
errorMessage: error.message,
errorStack: error.stack,
});
}
logger.warn("Error fetching transaction data", {
error: JSON.stringify(error),
});

return {
accumulativeTransactions: [],
accumulatedTokenAmountUSD: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export const getTransactionData = async (
new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(),
);
} catch (error) {
logger.warn("Error fetching transaction data", { error });
logger.warn("Error fetching transaction data", {
error: JSON.stringify(error),
});
return [];
}
};

0 comments on commit 7a5249b

Please sign in to comment.