Skip to content

Commit

Permalink
fix(schema): validateQuery - move next function outside of try-catch (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fratzinger committed Feb 14, 2023
1 parent d659858 commit 37fe5c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/schema/src/hooks/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export const validateQuery = <H extends HookContext>(schema: Schema<any> | Valid
...context.params,
query
}

if (typeof next === 'function') {
return next()
}
} catch (error: any) {
throw error.ajv ? new BadRequest(error.message, error.errors) : error
}

if (typeof next === 'function') {
return next()
}
}
}

Expand Down

0 comments on commit 37fe5c4

Please sign in to comment.