Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPLOAD-1409 - Enhanced error reporting #1665

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions app/actions/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,24 +205,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",
"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",
"version": "2.60.0-rollbar-enhance-errors",
"description": "Tidepool Project Universal Uploader",
"private": true,
"main": "main.prod.js",
Expand Down