Guest User

Untitled

a guest
Jun 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. function main() {
  2. try {
  3. doAllTheThings();
  4. }
  5.  
  6. catch(err) {
  7. console.error(err);
  8. reportError(err);
  9. }}
  10.  
  11.  
  12.  
  13. function doAllTheThings() {
  14. throw {
  15. message: "Everything's ruined",
  16. name: "FatalException",
  17. toString: function() {
  18. return `${this.name}: ${this.message}`;
  19. }
  20. }
  21. }
  22.  
  23. function reportError(e) {
  24. $('.js-error-report').text(`Uh oh, something went wrong! Here's what we know: ${e.message}`);
  25. }
  26.  
  27. $(main);
Add Comment
Please, Sign In to add comment