From ed6810c79b03b61dcb8a51694acaaf84aa7a8a16 Mon Sep 17 00:00:00 2001 From: Mentlegen <9807008+gentlementlegen@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:42:27 +0900 Subject: [PATCH] fix: log detailed error information when fetching token decimals Include error object in log for better debugging of failed token decimals retrieval. --- src/handlers/generate-erc20-permit.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handlers/generate-erc20-permit.ts b/src/handlers/generate-erc20-permit.ts index 9047659..b4c00f2 100644 --- a/src/handlers/generate-erc20-permit.ts +++ b/src/handlers/generate-erc20-permit.ts @@ -151,8 +151,8 @@ async function getTokenDecimals(tokenAddress: string, provider: ethers.providers const tokenContract = new ethers.Contract(tokenAddress, erc20Abi, provider); return await tokenContract.decimals(); } catch (error) { - const errorMessage = `Failed to get token decimals for token: ${tokenAddress}`; - logger.debug(errorMessage); + const errorMessage = `Failed to get token decimals for token: ${tokenAddress}, ${error}`; + logger.debug(errorMessage, { error }); throw new Error(errorMessage); } }