Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3872
Closed
Open
Issue created Sep 11, 2019 by Administrator@rootContributor

typescript-node: Reject Promises in using Error instances instead of plain objects

Created by: ghost

Is your feature request related to a problem? Please describe.

In generated typescript code promises are rejected with plain objects instead of error instances. By not using errors we loose stacktraces and thus easy debugging.

Describe the solution you'd like

Reject Promises with proper Error instances. This would be done here: https://github.com/OpenAPITools/openapi-generator/blob/e73bf9be1d79746b31046424f3ab011b0584ac95/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache#L225

I can provide a PR, if you are going to accept it. This would be a breaking change. I would add a new HttpError class with a statusCode property. Additionally We can add body and response. This would be a breaking change, but in my opinion a good one.

Describe alternatives you've considered

I don't think there is any viable alternative

Additional context

I come from kubernetes-client/javascript#336

Assignee
Assign to
Time tracking