Skip to content

Commit

Permalink
Add property to error objects
Browse files Browse the repository at this point in the history
  • Loading branch information
cowuake committed Oct 18, 2024
1 parent 0e7fe46 commit 762a6f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/error-handling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function mapFastifyErrorToErrorSchemaType(
return {
status: error.statusCode ?? HttpStatusCodes.InternalServerError,
type: error.name,
detail: error.message
detail: error.message,
code: error.code
// errors:
// error.validation !== undefined
// ? error.validation.map((validationError) => ({
Expand Down

0 comments on commit 762a6f4

Please sign in to comment.