2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Added errors to be displayed when the query parsing process itself fails. (#3961)

* Adding errors when the query parsing process fails

* Updated error

* Removed unused variables

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Daniel
2022-01-18 22:20:33 +05:30
committed by GitHub
parent 4461761fcb
commit 1163588aa2
2 changed files with 25 additions and 0 deletions
+10
View File
@@ -138,6 +138,16 @@ module.exports = function httpAdapter(config) {
var isHttpsRequest = isHttps.test(protocol);
var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
try {
buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, '');
} catch (err) {
var customErr = new Error(err.message);
customErr.config = config;
customErr.url = config.url;
customErr.exists = true;
reject(customErr);
}
var options = {
path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
method: config.method.toUpperCase(),