-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Better error message for missing url #3110
Copy link
Copy link
Closed
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels