Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main() {
- try {
- doAllTheThings();
- }
- catch(e) {
- console.error(reportError(e));
- }
- }
- function doAllTheThings() {
- throw {
- message: "Everything's ruined",
- name: "FatalException",
- toString: function() {
- return `${this.name}: ${this.message}`;
- }
- }
- }
- function reportError(e) {
- $('.js-error-report').text(`Uh oh, something went wrong! Here's what we know: ${e.message}`);
- }
- $(main);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement