nestia
nestia copied to clipboard
TypedException error occurs when using applyDecorators after upgrading from version 3.2.1 to 3.12.0
@Controller("bbs/articles/:section")
export class BbsArticlesController {
@core.TypedRoute.Patch()
@TypedException<UnauthorizedException>({
status: 401,
description: "Unauthorized",
})
public index(
@core.TypedParam("section") section: string,
@core.TypedBody() input: IBbsArticle.IRequest,
): Promise<IPage<IBbsArticle.ISummary>> {
return BbsArticleProvider.index(section, input);
}
}
There is no issue when used as shown in the code above.
const appliedDecorators = applyDecorators(
TypedException<UnauthorizedException>({
status: 401,
description: "Unauthorized",
}),
);
@Controller("bbs/articles/:section")
export class BbsArticlesController {
@core.TypedRoute.Patch()
@appliedDecorators
public index(
@core.TypedParam("section") section: string,
@core.TypedBody() input: IBbsArticle.IRequest,
): Promise<IPage<IBbsArticle.ISummary>> {
return BbsArticleProvider.index(section, input);
}
}
However, when using applyDecorators, the error ‘Unable to find Exception type.’ occurs.
$ rimraf src/api/functional && nestia sdk
-----------------------------------------------------------
Nestia SDK Generator
-----------------------------------------------------------
[Nest] 65460 - 08/30/2024, 4:26:26 PM LOG [NestFactory] Starting Nest application...
[Nest] 65460 - 08/30/2024, 4:26:26 PM LOG [InstanceLoader] MyModule dependencies initialized +4ms
[Nest] 65460 - 08/30/2024, 4:26:26 PM LOG [InstanceLoader] BbsArticleModule dependencies initialized +1ms
Analyzing reflections
-----------------------------------------------------------
Nestia Error Report
-----------------------------------------------------------
src/controllers/bbs/BbsArticlesController.ts - BbsArticlesController.index() from exception (status: 401):
- Unable to find exception type.
✨ Done in 2.00s.