From 8aa7eb2fcbe22df5558e532db1c90bdef54a0bcd Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 6 Sep 2024 15:43:19 +0200 Subject: [PATCH] [Dev] Teact: Better error logging --- src/lib/teact/teact.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/teact/teact.ts b/src/lib/teact/teact.ts index 5edacc7eb..bc03afe53 100644 --- a/src/lib/teact/teact.ts +++ b/src/lib/teact/teact.ts @@ -442,7 +442,7 @@ export function renderComponent(componentInstance: ComponentInstance) { } }, () => { // eslint-disable-next-line no-console - console.error(`[Teact] Error while rendering component ${componentInstance.name}`); + console.error(`[Teact] Error while rendering component ${componentInstance.name}`, componentInstance); newRenderedValue = componentInstance.renderedValue; }); @@ -681,8 +681,8 @@ function useEffectBase( } } }, () => { - // eslint-disable-next-line no-console - console.error(`[Teact] Error in effect cleanup at cursor #${cursor} in ${componentInstance.name}`); + // eslint-disable-next-line no-console, max-len + console.error(`[Teact] Error in effect cleanup at cursor #${cursor} in ${componentInstance.name}`, componentInstance); }, () => { byCursor[cursor].cleanup = undefined; }); @@ -713,7 +713,7 @@ function useEffectBase( } }, () => { // eslint-disable-next-line no-console - console.error(`[Teact] Error in effect at cursor #${cursor} in ${componentInstance.name}`); + console.error(`[Teact] Error in effect at cursor #${cursor} in ${componentInstance.name}`, componentInstance); }); function schedule() {