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 0f594a1 commit 50dc374
Show file tree
Hide file tree
Showing 3 changed files with 6 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/artisan",
"version": "5.1.0",
"version": "5.2.0",
"description": "The Athenna CLI application. Built on top of commander and inspired in @adonisjs/ace.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
4 changes: 3 additions & 1 deletion src/handlers/ConsoleExceptionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export class ConsoleExceptionHandler {
* The exception handler of all Artisan commands.
*/
public async handle(error: any): Promise<void> {
error.code = String.toSnakeCase(error.code || error.name).toUpperCase()
error.code = String.toSnakeCase(
`${error.code}` || `${error.name}`
).toUpperCase()

const isException = Is.Exception(error)
const isDebugMode = Config.get('app.debug', true)
Expand Down

0 comments on commit 50dc374

Please sign in to comment.