diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-05-15 21:17:08 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-15 21:17:08 -0300 |
commit | 232f2ed5e96c7a605b294a619a8715dd2a9fd682 (patch) | |
tree | a14b53833fbf051565f99ba3e75c05209f546307 /src/write/build-modes | |
parent | aeb8c1d4aa11ced91d4228541cd340530c8452f5 (diff) |
write: live-dev-server: better web route file error logging
Diffstat (limited to 'src/write/build-modes')
-rw-r--r-- | src/write/build-modes/live-dev-server.js | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |