Skip to content

Commit

Permalink
fix: more informative express error log
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewPattell committed Oct 11, 2024
1 parent d7b17fa commit 320aefb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ async function createServer(config: ServerConfig): Promise<ICreateServerOut> {

await render(config, context, renderParams);
} catch (e) {
config.getLogger().error('Failed to handle request', { error: e as Error });
config
.getLogger()
.error(`Failed to handle request: ${(e as Error)?.message}`, { error: e as Error });
next();
}
})();
Expand All @@ -124,7 +126,9 @@ async function createServer(config: ServerConfig): Promise<ICreateServerOut> {

res.send(html);
} catch (e) {
config.getLogger().error('Failed to handle request', { error: e as Error });
config
.getLogger()
.error(`Failed to handle request: ${(e as Error)?.message}`, { error: e as Error });
next();
}
})();
Expand Down

0 comments on commit 320aefb

Please sign in to comment.