Skip to content

Commit

Permalink
feat(handler): respect when code is not a string
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Dec 27, 2024
1 parent 5cef705 commit 7bdb8bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/http",
"version": "5.5.0",
"version": "5.6.0",
"description": "The Athenna Http server. Built on top of fastify.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/HttpExceptionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class HttpExceptionHandler {
const body: any = {
statusCode: Json.copy(error.statusCode) || Json.copy(error.status) || 500,
code: String.toSnakeCase(
error.code || error.name || 'E_INTERNAL_SERVER'
`${error.code}` || error.name || 'E_INTERNAL_SERVER'
).toUpperCase(),
name: Json.copy(error.name),
message: Json.copy(error.message),
Expand Down

0 comments on commit 7bdb8bf

Please sign in to comment.