Skip to content
Permalink
Browse files

Added some mock third-party errors to the dev example so we can check…

… that console warnings, errors and promise rejections aren't caught by our version of Sentry and cause broken stack traces.
  • Loading branch information...
SirRawlins committed Jun 1, 2018
1 parent 414a3ea commit 029e6e2cacb626d26a69b63c8861d1724f9a3dd0
Showing with 35 additions and 2 deletions.
  1. +4 −2 index.html
  2. +31 −0 third-party-error.js
@@ -39,8 +39,10 @@
}
}
</script>

<!-- Load in our library. -->
<script async src="dist/status-bar.min.js" data-for="f1ff551f" data-environment="development"></script>
<script src="dist/status-bar.min.js" data-for="f1ff551f"></script>
<!-- Third-party mock to test conflicts. -->
<script src="third-party-error.js"></script>
</body>
</html>
@@ -0,0 +1,31 @@
/*
* A mock third-party JavaScript lib to test that the website plugin
* isn't conflicting with other peoples code.
*/

(function(window, document, undefined) { "use strict";

/* Generic error message. */
var error_msg = 'Third-party library error, stack track should NOT show as from status-bar.js'

/*
* Raise a warning/error to ensure that the
* plugin still runs, and doesn't log the
* the exception.
*/
// Console warning.
console.warn(error_msg);

// Uncaught promise rejections.
Promise.reject(new Error(error_msg)).then(function(result) {
// Promise resolved.
console.log('Promise was resolved');
}, function(result) {
// Promise rejected.
console.log(result);
});

// Proper exception.
throw new Error(error_msg);

})(window, document);

0 comments on commit 029e6e2

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.