Skip to content

Add original error property #2010

@rightaway

Description

@rightaway

What problem are you trying to solve?

@szmarczak asked me to create a separate issue (#1865 (comment)).

Could you add a property on the got Error object like original that stores the original Error if there was one for example from socks-proxy-agent? It would really help with more involved error handling scenarios.

Describe the feature

More background is at #1865.

The cause property could be used https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#differentiate_between_similar_errors since it is standard.

Checklist

  • I have read the documentation and made sure this feature doesn't already exist.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions