Skip to content

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

@ghost

Description

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:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions