fix(api-gateway): add debug logs for errors on parsing

This commit is contained in:
Karol Sójko 2023-11-13 07:39:34 +01:00
parent fddd17e531
commit 60686dcdbd
No known key found for this signature in database
GPG key ID: B06B39F95BCFA624

View file

@ -92,6 +92,7 @@ void container.load().then((container) => {
server.setErrorConfig((app) => { server.setErrorConfig((app) => {
app.use((error: Record<string, unknown>, request: Request, response: Response, _next: NextFunction) => { app.use((error: Record<string, unknown>, request: Request, response: Response, _next: NextFunction) => {
logger.error(`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Error thrown: ${error.stack}`) logger.error(`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Error thrown: ${error.stack}`)
logger.debug(`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Request body: ${request.body}`)
response.status(500).send({ response.status(500).send({
error: { error: {