Skip to content

Commit 5e77604

Browse files
authoredMar 12, 2025
fix: improve logging of errors (closes DELO-4986) (#121)
* fix: serialize errors array to string * better error handling * better error handling
1 parent 6b5f243 commit 5e77604

File tree

4 files changed

+211
-189
lines changed

4 files changed

+211
-189
lines changed
 

‎cloudinary/apiCaller.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ const sendToCloudinary = (imagesArray, batchSize, dpr, metaData, quality, cb, ro
7979
analyzeResults.push(result);
8080
callback();
8181
}
82-
});
82+
}).catch(error => {
83+
logger.error('cloudinary upload error', error, rollBarMsg);
84+
});
8385
}, err => {
8486
if (uploadErrors.length > 0) {
85-
logger.error('cloudinary upload errors', uploadErrors, rollBarMsg);
87+
logger.error(`cloudinary upload errors: ${uploadErrors.length} issues`, rollBarMsg);
8688
}
8789
if (err) {
8890
cb({

‎package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
},
1010
"dependencies": {
1111
"@opentelemetry/api": "^1.9.0",
12-
"@opentelemetry/exporter-prometheus": "^0.57.1",
13-
"@opentelemetry/instrumentation-express": "^0.47.0",
14-
"@opentelemetry/instrumentation-http": "^0.57.1",
12+
"@opentelemetry/exporter-prometheus": "^0.57.2",
13+
"@opentelemetry/instrumentation-express": "^0.47.1",
14+
"@opentelemetry/instrumentation-http": "^0.57.2",
1515
"@opentelemetry/resources": "^1.30.1",
16-
"@opentelemetry/sdk-node": "^0.57.1",
16+
"@opentelemetry/sdk-node": "^0.57.2",
1717
"@opentelemetry/sdk-trace-base": "^1.30.1",
18-
"@opentelemetry/semantic-conventions": "^1.29.0",
18+
"@opentelemetry/semantic-conventions": "^1.30.0",
1919
"async": "^3.2.6",
2020
"async-mutex": "^0.5.0",
2121
"bytes": "^3.1.2",
@@ -36,7 +36,7 @@
3636
"chai-http": "^4.4.0",
3737
"husky": "^9.1.7",
3838
"mocha": "^11.1.0",
39-
"nock": "^14.0.0",
39+
"nock": "^14.0.1",
4040
"patch-package": "^8.0.0",
4141
"sinon": "^19.0.2",
4242
"sinon-chai": "^3.7.0"

‎wtp/apiCaller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ const runWtpTest = async (url, mobile, cb) => {
8484
let rollBarMsg = {testId: "", analyzedUrl: url, thirdPartyErrorCode: "", thirdPartyErrorMsg: "", file: path.basename((__filename))};
8585
try {
8686
response = await got(options);
87-
logger.info("Started WPT test");
8887
const {statusCode, body} = response;
8988
if (statusCode !== 200) {
9089
rollBarMsg.thirdPartyErrorCode = response.statusCode;
@@ -100,6 +99,7 @@ const runWtpTest = async (url, mobile, cb) => {
10099
rollBarMsg.testId = (typeof bodyJson.data !== 'undefined' && typeof bodyJson.data.testId !== 'undefined') ?
101100
(bodyJson.data.testId) :
102101
"N/A";
102+
logger.info("Started WPT test", {"testId": rollBarMsg.testId});
103103
let testId = resultParser.parseTestResponse(bodyJson, rollBarMsg);
104104
if (typeof testId === 'object') {
105105
cb(null, testId);

0 commit comments

Comments
 (0)