Skip to content

Commit d3dd8d7

Browse files
Merge branch 'axios-master-without-speedboats' of github.com:browserstack/browserstack-cypress-cli into ats_fixes
2 parents da25bb1 + 0ea68a9 commit d3dd8d7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

bin/helpers/helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ exports.truncateString = (field, truncateSizeInBytes) => {
445445
exports.setAxiosProxy = (axiosConfig) => {
446446
if (process.env.HTTP_PROXY || process.env.HTTPS_PROXY) {
447447
const httpProxy = process.env.HTTP_PROXY || process.env.HTTPS_PROXY
448+
axiosConfig.proxy = false;
448449
axiosConfig.httpsAgent = new HttpsProxyAgent(httpProxy);
449450
};
450451
};

bin/helpers/usageReporting.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ async function send(args) {
338338
retries: 3,
339339
retryDelay: 2000,
340340
retryCondition: (error) => {
341-
return (error.response.status === 503 || error.response.status === 500)
341+
return utils.isNotUndefined(error.response) && (error.response.status === 503 || error.response.status === 500)
342342
}
343343
});
344344
try {
@@ -350,7 +350,11 @@ async function send(args) {
350350
};
351351
fileLogger.info(`${JSON.stringify(result)}`);
352352
} catch (error) {
353-
fileLogger.error(JSON.stringify(error.response.data));
353+
if (error.response) {
354+
fileLogger.error(JSON.stringify(error.response.data));
355+
} else {
356+
fileLogger.error(`Error sending usage data: ${error.message}`);
357+
}
354358
return;
355359
}
356360
}

0 commit comments

Comments
 (0)