Skip to content

Commit

Permalink
Update src/titiler_fetcher.mjs
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
dqunbp and coderabbitai[bot] authored Nov 13, 2024
1 parent 9ab4639 commit 79dd872
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/titiler_fetcher.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 79dd872

Please sign in to comment.