Skip to content

Commit 85fb5d0

Browse files
authored
Merge pull request #225 from AthennaIO/develop
chore(handler): adjust when code is not string
2 parents 2058d2e + a1eec55 commit 85fb5d0

File tree

3 files changed

+83
-33
lines changed

3 files changed

+83
-33
lines changed

package-lock.json

Lines changed: 81 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/http",
3-
"version": "5.39.0",
3+
"version": "5.40.0",
44
"description": "The Athenna Http server. Built on top of fastify.",
55
"license": "MIT",
66
"author": "João Lenon <[email protected]>",

src/handlers/HttpExceptionHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class HttpExceptionHandler {
3232
public async handle({ error, response }: ErrorContext): Promise<void> {
3333
let code = error.code
3434

35-
if (error.code === undefined) {
35+
if (!Is.String(code) || Is.Undefined(code)) {
3636
code = error.name || 'E_INTERNAL_SERVER'
3737
}
3838

0 commit comments

Comments
 (0)