Skip to content

Commit

Permalink
Merge pull request #1665 from tidepool-org/UPLOAD-1409-rollbar-enhanc…
Browse files Browse the repository at this point in the history
…e-errors

UPLOAD-1409 - Enhanced error reporting
  • Loading branch information
gniezen authored Jan 27, 2025
2 parents 343f135 + 94e2a8f commit 8762c22
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
34 changes: 18 additions & 16 deletions app/actions/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,24 +211,26 @@ export function mergeProfileUpdates(profile, updates){

export function sendToRollbar(err, props) {
return new Promise((resolve) => {
if (rollbar) {
const extra = {};
if (_.get(props, 'data.blobId', false)) {
_.assign(extra, { blobId: props.data.blobId });
}
if (!rollbar) {
return resolve(props);
}

rollbar.error(err, extra, (err, data) => {
if (err) {
console.log('Error while reporting error to Rollbar:', err);
} else {
console.log(`Rollbar UUID: ${data.result.uuid}`);
props.uuid = data.result.uuid;
}
resolve(props);
});
} else {
resolve(props);
const extra = { ...props };
delete extra.data;

if (_.get(props, 'data.blobId', false)) {
extra.blobId = props.data.blobId;
}

rollbar.error(err, extra, (reportingErr, data) => {
if (reportingErr) {
console.log('Error while reporting error to Rollbar:', reportingErr);
} else {
console.log(`Rollbar UUID: ${data.result.uuid}`);
props.uuid = data.result.uuid;
}
resolve(props);
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tidepool-uploader",
"productName": "tidepool-uploader",
"version": "2.60.0-accu-chek-no-records.1",
"version": "2.60.0-rollbar-enhance-errors",
"description": "Tidepool Project Universal Uploader",
"main": "./main.prod.js",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tidepool-uploader",
"version": "2.60.0-accu-chek-no-records.1",
"version": "2.60.0-rollbar-enhance-errors",
"description": "Tidepool Project Universal Uploader",
"private": true,
"main": "main.prod.js",
Expand Down

0 comments on commit 8762c22

Please sign in to comment.