Skip to content

Commit

Permalink
uuid fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy committed Nov 4, 2022
1 parent a5b65dd commit 06dba74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { logger } from "./logger"
import { Router } from "./server/router"
import * as swaggerUi from "swagger-ui-express"
import * as http from "http"
import { v4 as uuidv4 } from "uuid"
import { config } from "./server/config"
import { StatusCode } from "./server/utils/status-code"
import { NextFunction, Request, Response } from "express"
import { PgError } from "./server/errors/pgError"
import * as uuid from "uuid"
// eslint-disable-next-line @typescript-eslint/no-var-requires
const swaggerDocument = require("../openapi.json")

Expand Down Expand Up @@ -61,7 +61,7 @@ export class App {
const { payload: { message } } = error.output
return res.status(error.output.statusCode).json({ message })
}
const errorId = uuid()
const errorId = uuidv4()
logger.error(`Unexpected error: ${error}, errorId: ${errorId}`)
return res.status(StatusCode.InternalError).json({ message: `Unexpected error occurred: ${errorId}` })

Expand Down

0 comments on commit 06dba74

Please sign in to comment.