Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw better error if url doesnt exist #3111

Closed
wants to merge 3 commits into from
Closed

Conversation

shayneo
Copy link

@shayneo shayneo commented Jul 9, 2020

Issue: #3110

Throws a friendly error when url doesn't exist

@MoonSupport
Copy link

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

I think it would be better to fix it.

@@ -66,6 +66,9 @@ Axios.prototype.request = function request(config) {

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

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
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.

None yet

5 participants