fix(api-gateway): add more info on error logs

This commit is contained in:
Karol Sójko 2023-11-10 15:13:54 +01:00
parent daad76d0dd
commit f99750169f
No known key found for this signature in database
GPG key ID: C2F813669419D05F

View file

@ -90,8 +90,8 @@ void container.load().then((container) => {
const logger: winston.Logger = container.get(TYPES.ApiGateway_Logger)
server.setErrorConfig((app) => {
app.use((error: Record<string, unknown>, _request: Request, response: Response, _next: NextFunction) => {
logger.error(error.stack)
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}`)
response.status(500).send({
error: {