From c95d269fbc089f3309ee8fdab1791f95505e4b46 Mon Sep 17 00:00:00 2001 From: williamlardier Date: Tue, 26 Nov 2024 16:10:51 +0100 Subject: [PATCH] Enforce using the arsenal error in route utils Issue: ARSN-441 --- lib/s3routes/routesUtils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/s3routes/routesUtils.ts b/lib/s3routes/routesUtils.ts index e82bbae86..9e34e9e37 100644 --- a/lib/s3routes/routesUtils.ts +++ b/lib/s3routes/routesUtils.ts @@ -730,7 +730,7 @@ export function errorHtmlResponse( } log.trace('sending generic html error page', - { err }); + { error }); setCommonResponseHeaders(corsHeaders, response, log); response.writeHead(error.code, { 'Content-type': 'text/html' }); const html: string[] = []; @@ -800,9 +800,9 @@ export function errorHeaderResponse( error = errors.InternalError.customizeDescription(err.message); } log.trace('sending error header response', - { err }); + { error }); setCommonResponseHeaders(corsHeaders, response, log); - response.setHeader('x-amz-error-code', err.message); + response.setHeader('x-amz-error-code', error.message); response.setHeader('x-amz-error-message', error.description); response.writeHead(error.code); return response.end(() => { @@ -941,9 +941,9 @@ export function redirectRequestOnError( if (method === 'HEAD') { return errorHeaderResponse(error, response, corsHeaders, log); } - response.setHeader('x-amz-error-code', err.message); + response.setHeader('x-amz-error-code', error.message); response.setHeader('x-amz-error-message', error.description); - return errorHtmlResponse(err, false, '', response, corsHeaders, log); + return errorHtmlResponse(error, false, '', response, corsHeaders, log); } // This is reached only for website error document (GET only)