mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Adding error handling when missing url (#3791)
* Fixing error message when missing url * Fixing missing url * Adding missing url case * Update Axios.js * Update requests.spec.js * Update api.spec.js * Update api.spec.js * Update api.spec.js Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
committed by
GitHub
parent
99648153ce
commit
95792908f0
@@ -36,6 +36,10 @@ Axios.prototype.request = function request(configOrUrl, config) {
|
||||
config = configOrUrl || {};
|
||||
}
|
||||
|
||||
if (!config.url) {
|
||||
throw new Error('Provided config url is not valid');
|
||||
}
|
||||
|
||||
config = mergeConfig(this.defaults, config);
|
||||
|
||||
// Set config.method
|
||||
@@ -118,6 +122,9 @@ Axios.prototype.request = function request(configOrUrl, config) {
|
||||
};
|
||||
|
||||
Axios.prototype.getUri = function getUri(config) {
|
||||
if (!config.url) {
|
||||
throw new Error('Provided config url is not valid');
|
||||
}
|
||||
config = mergeConfig(this.defaults, config);
|
||||
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user