Skip to content

Better error message for missing url #3110

@shayneo

Description

@shayneo

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

The error that occurs when making an axios request with a url that is undefined is unclear. This is problematic because I often write code that programmatically generates the url for the request, or uses the response from a previous request to compose the next request.

Describe the solution you'd like

If a url is falsey in the request config, throw a very clear error that indicates that no url was provided

Describe alternatives you've considered

Making sure I write better code that doesn't generate undefined urls

Additional context

This is the error generated currently Uncaught (in promise) TypeError: can't access property "protocol", n is undefined, which is not the most helpful in terms of pinpointing the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions