Skip to content

Throw better error if url doesnt exist#3111

Closed
shayneo wants to merge 3 commits intoaxios:masterfrom
shayneo:patch-2
Closed

Throw better error if url doesnt exist#3111
shayneo wants to merge 3 commits intoaxios:masterfrom
shayneo:patch-2

Conversation

@shayneo
Copy link
Copy Markdown

@shayneo shayneo commented Jul 9, 2020

Issue: #3110

Throws a friendly error when url doesn't exist

@MoonSupport
Copy link
Copy Markdown

@shayneo
eslint:target does not allow backtick syntax, so ci is broken.

I think it would be better to fix it.

Axios.prototype.getUri = function getUri(config) {
config = mergeConfig(this.defaults, config);
if (!config.url) {
throw new Error('url of ' + config.url + 'is invalid for axios request');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the config.url is falsey (such an empty string), wouldn't this error message be not indicative?
in this example, if the url is '' the error message would be 'url of is invalid for axios request'

@jasonsaayman
Copy link
Copy Markdown
Member

Closing in favour of #3791

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants