From 37fe5c4a4d813867f6d02098b7c77d08786248c7 Mon Sep 17 00:00:00 2001 From: fratzinger <22286818+fratzinger@users.noreply.github.com> Date: Tue, 14 Feb 2023 01:07:10 +0100 Subject: [PATCH] fix(schema): validateQuery - move next function outside of try-catch (#3053) --- packages/schema/src/hooks/validate.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/schema/src/hooks/validate.ts b/packages/schema/src/hooks/validate.ts index dc31de5fbe..2ca30e7900 100644 --- a/packages/schema/src/hooks/validate.ts +++ b/packages/schema/src/hooks/validate.ts @@ -19,13 +19,13 @@ export const validateQuery = (schema: Schema | 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() + } } }