From 9946dfcb7fe1df0593dc1c1d2b25c010904a1d29 Mon Sep 17 00:00:00 2001 From: Thibaud Ollagnier Date: Tue, 20 Oct 2026 13:34:16 +0200 Subject: [PATCH] fix: attach the caught error as cause when loading Albert documentation fails --- server/routes/nuxt-api/albert/utils/fetch-documentation.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/routes/nuxt-api/albert/utils/fetch-documentation.ts b/server/routes/nuxt-api/albert/utils/fetch-documentation.ts index bcd734e02..7cb37e061 100644 --- a/server/routes/nuxt-api/albert/utils/fetch-documentation.ts +++ b/server/routes/nuxt-api/albert/utils/fetch-documentation.ts @@ -337,7 +337,7 @@ export async function fetchDocumentationContent(url: string): Promise { clearTimeout(timeoutId) if (error instanceof Error) { if (error.name === 'AbortError') { - throw new Error(`Documentation URL could not be loaded within ${FETCH_TIMEOUT_MS / 1000} seconds.`) + throw new Error(`Documentation URL could not be loaded within ${FETCH_TIMEOUT_MS / 1000} seconds.`, { cause: error }) } if ( error.message === DISALLOWED_URL_MESSAGE @@ -346,9 +346,9 @@ export async function fetchDocumentationContent(url: string): Promise { ) { throw error } - throw new Error(`Failed to load documentation from URL: ${error.message}`) + throw new Error(`Failed to load documentation from URL: ${error.message}`, { cause: error }) } - throw new Error('Failed to load documentation from URL.') + throw new Error('Failed to load documentation from URL.', { cause: error }) } }