Skip to content

Commit

Permalink
Merge pull request #1521 from hpx7/patch-1
Browse files Browse the repository at this point in the history
Fix koa ValidateError
  • Loading branch information
WoH authored Dec 22, 2023
2 parents 8b30ec7 + a492c91 commit 9c46f2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/src/routeGeneration/templates/koa.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ export function RegisterRoutes(router: KoaRouter) {
validatedArgs = getValidatedArgs(args, context, next);
} catch (err) {
const error = err as any;
error.message ||= JSON.stringify({ fields: error.fields });
context.status = error.status;
context.throw(error.status, JSON.stringify({ fields: error.fields }));
context.throw(context.status, error.message, error);
}

{{#if ../../iocModule}}
Expand Down

0 comments on commit 9c46f2a

Please sign in to comment.