Skip to content

Commit

Permalink
fix: lint issue
Browse files Browse the repository at this point in the history
Signed-off-by: Avior <git@avior.me>
  • Loading branch information
Aviortheking committed Jul 25, 2024
1 parent 3c33488 commit a31f2b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/src/libs/Errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ export function sendError(error: Errors, res: Response, metadata?: Record<string
...metadata
}

if (details[error]) {
json.details = details[error](metadata)
const dt = details[error]
if (dt) {
json.details = dt(metadata)
}

res.status(json.status ?? 500).json(json).end()
Expand Down

0 comments on commit a31f2b9

Please sign in to comment.