From 79dd872b8582293fd899b92082b056ce756d2be8 Mon Sep 17 00:00:00 2001 From: dqunbp Date: Wed, 13 Nov 2024 12:40:52 +0400 Subject: [PATCH] Update src/titiler_fetcher.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- src/titiler_fetcher.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/titiler_fetcher.mjs b/src/titiler_fetcher.mjs index da3b673..2b4474b 100644 --- a/src/titiler_fetcher.mjs +++ b/src/titiler_fetcher.mjs @@ -49,10 +49,17 @@ async function enqueueTileFetching(tileUrl, z, x, y) { const request = tileRequestQueue .add(() => fetchTile(url), { priority: Math.pow(2, z), timeout: FETCH_QUEUE_TTL_MS }) .catch((error) => { + const logContext = { + url, + zoomLevel: z, + errorType: error.name, + errorMessage: error.message, + timeout: FETCH_QUEUE_TTL_MS + }; if (error.name === "TimeoutError") { - console.error(`Tile request timed out after ${FETCH_QUEUE_TTL_MS}ms for URL: ${url}`); + console.error('Tile request timeout', logContext); } else { - console.error(`Error fetching tile: ${url}`, error); + console.error('Tile request failed', logContext); } }) .finally(() => {