diff --git a/packages/core/src/decorator/web/paramMapping.ts b/packages/core/src/decorator/web/paramMapping.ts index 10503d841b57..0aee57e0b93e 100644 --- a/packages/core/src/decorator/web/paramMapping.ts +++ b/packages/core/src/decorator/web/paramMapping.ts @@ -68,6 +68,8 @@ export const createRequestParamDecorator = function ( pipes: pipesOrOptions as Array, }; } + if (pipesOrOptions.throwError == null) pipesOrOptions.throwError = true; + return createParamMapping(RouteParamTypes.CUSTOM)(transform, pipesOrOptions); }; diff --git a/packages/core/test/decorator/web/__snapshots__/paramMapping.test.ts.snap b/packages/core/test/decorator/web/__snapshots__/paramMapping.test.ts.snap index a7255da9f37a..3d65f88ab324 100644 --- a/packages/core/test/decorator/web/__snapshots__/paramMapping.test.ts.snap +++ b/packages/core/test/decorator/web/__snapshots__/paramMapping.test.ts.snap @@ -14,6 +14,7 @@ exports[`/test/web/paramMapping.test.ts paramMapping decorator should be ok 1`] "pipes": [ [Function], ], + "throwError": true, }, "parameterIndex": 9, "propertyName": "doget",