From 232f2ed5e96c7a605b294a619a8715dd2a9fd682 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 15 May 2024 21:17:08 -0300 Subject: write: live-dev-server: better web route file error logging --- src/write/build-modes/live-dev-server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/write') diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js index cb878337..21791da4 100644 --- a/src/write/build-modes/live-dev-server.js +++ b/src/write/build-modes/live-dev-server.js @@ -312,12 +312,13 @@ export async function go({ if (error.code === 'EISDIR') { response.writeHead(404, contentTypePlain); response.end(`File not found for: ${safePath}`); + console.error(`${requestHead} [404] ${pathname} (is directory)`); } else { response.writeHead(500, contentTypePlain); response.end(`Failed during file-to-response pipeline`); + console.error(`${requestHead} [500] ${pathname}`); + showError(error); } - console.error(`${requestHead} [500] ${pathname}`); - showError(error); } return; } -- cgit 1.3.0-6-gf8a5