Skip to content

Commit d04b0d7

Browse files
committed
Update dist with improvements from #163
1 parent eb21e6c commit d04b0d7

6 files changed

+24
-10
lines changed

dist/stacktrace-with-promises-and-json-polyfills.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,12 +2415,13 @@ if (!Array.prototype.forEach) {
24152415
},
24162416

24172417
/**
2418-
* Given an Array of StackFrames, serialize and POST to given URL.
2418+
* Given an error message and Array of StackFrames, serialize and POST to given URL.
24192419
*
24202420
* @param {Array} stackframes
24212421
* @param {String} url
2422+
* @param {String} errorMsg
24222423
*/
2423-
report: function StackTrace$$report(stackframes, url) {
2424+
report: function StackTrace$$report(stackframes, url, errorMsg) {
24242425
return new Promise(function(resolve, reject) {
24252426
var req = new XMLHttpRequest();
24262427
req.onerror = reject;
@@ -2435,7 +2436,13 @@ if (!Array.prototype.forEach) {
24352436
};
24362437
req.open('post', url);
24372438
req.setRequestHeader('Content-Type', 'application/json');
2438-
req.send(JSON.stringify({stack: stackframes}));
2439+
2440+
var reportPayload = {stack: stackframes};
2441+
if (errorMsg != undefined) {
2442+
reportPayload.message = errorMsg;
2443+
}
2444+
2445+
req.send(JSON.stringify(reportPayload));
24392446
});
24402447
}
24412448
};

dist/stacktrace-with-promises-and-json-polyfills.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace-with-promises-and-json-polyfills.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace.concat.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,13 @@
430430
},
431431

432432
/**
433-
* Given an Array of StackFrames, serialize and POST to given URL.
433+
* Given an error message and Array of StackFrames, serialize and POST to given URL.
434434
*
435435
* @param {Array} stackframes
436436
* @param {String} url
437+
* @param {String} errorMsg
437438
*/
438-
report: function StackTrace$$report(stackframes, url) {
439+
report: function StackTrace$$report(stackframes, url, errorMsg) {
439440
return new Promise(function(resolve, reject) {
440441
var req = new XMLHttpRequest();
441442
req.onerror = reject;
@@ -450,7 +451,13 @@
450451
};
451452
req.open('post', url);
452453
req.setRequestHeader('Content-Type', 'application/json');
453-
req.send(JSON.stringify({stack: stackframes}));
454+
455+
var reportPayload = {stack: stackframes};
456+
if (errorMsg != undefined) {
457+
reportPayload.message = errorMsg;
458+
}
459+
460+
req.send(JSON.stringify(reportPayload));
454461
});
455462
}
456463
};

dist/stacktrace.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)