move errors to fit in logger.error

This commit is contained in:
creations 2025-02-27 13:32:51 -05:00
parent 447dca754b
commit 9295f90741
Signed by: creations
GPG key ID: 8F553AA4320FC711
4 changed files with 16 additions and 9 deletions

View file

@ -83,8 +83,10 @@ class ServerHandler {
return new Response("Not Found", { status: 404 });
}
} catch (error) {
logger.error(`Error serving static file: ${pathname}`);
logger.error(error as Error);
logger.error([
`Error serving static file: ${pathname}`,
error as Error,
]);
return new Response("Internal Server Error", { status: 500 });
}
}
@ -179,8 +181,10 @@ class ServerHandler {
}
}
} catch (error: unknown) {
logger.error(`Error handling route ${request.url}:`);
logger.error(error as Error);
logger.error([
`Error handling route ${request.url}:`,
error as Error,
]);
response = Response.json(
{