Skip to content

Add non-throwing variants #88

Description

@maxdeviant

I was very surprised to discover that getReasonPhrase throws an exception when given an HTTP status code that the library does not know about.

Could we add non-throwing variants of getReasonPhrase and getStatusCode that return undefined instead of throwing an exception?

Having to catch the exception just to handle these cases gracefully is not very ergonomic.

I would be willing to open a PR for this if it would be accepted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions