fix(api-gateway): debug log on error thrown body representation

This commit is contained in:
Karol Sójko 2023-11-13 09:56:54 +01:00
parent 3fa01a328b
commit c8bf4ab3a0
No known key found for this signature in database
GPG key ID: C2F813669419D05F

View file

@ -92,7 +92,11 @@ void container.load().then((container) => {
server.setErrorConfig((app) => {
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.debug(`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Request body: ${request.body}`)
logger.debug(
`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Request body: ${JSON.stringify(
request.body,
)}`,
)
response.status(500).send({
error: {