Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypedException error occurs when using applyDecorators after upgrading from version 3.2.1 to 3.12.0 #1005

Open
oz-k opened this issue Aug 30, 2024 · 1 comment
Assignees
Labels
wontfix This will not be worked on

Comments

@oz-k
Copy link

oz-k commented Aug 30, 2024

@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.
@oz-k oz-k changed the title TypedException error when using applyDecorators after upgrading from version 3.2.1 to 3.12.0 TypedException error occurs when using applyDecorators after upgrading from version 3.2.1 to 3.12.0 Aug 30, 2024
@samchon
Copy link
Owner

samchon commented Aug 30, 2024

I'm sorry but no way to revive it now.

Please use @TypedException() independently please.

@samchon samchon self-assigned this Aug 30, 2024
@samchon samchon added the wontfix This will not be worked on label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants