Skip to content

Return error code for bad requests / server errors #10

Description

@pcarranzav

Currently, when a request fails, the module does:

throw new Error(body)

It would be better to have something like:

err = new Error(body)
err.statusCode = response.statusCode
throw err

So that API consumers can identify the error type without having to check the error message string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions