Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function main() {
  2. try {doAllTheThings();
  3. }
  4. catch (e){
  5. console.error(e);
  6. reportError(e);
  7. }
  8. }
  9. function doAllTheThings() {
  10. throw {
  11. message: "Everything's ruined",
  12. name: "FatalException",
  13. toString: function(){return this.name + ": " + this.message;}
  14. }
  15. }
  16.  
  17. function reportError(e) {
  18. catch $('.js-error-report').text("Uh oh, something went wrong! Here's what we know: " + e.message);
  19. }
  20.  
  21.  
  22.  
  23. /* From here down, you are not expected to
  24. understand.... for now :)
  25.  
  26.  
  27. Nothing to see here!
  28.  
  29. */
  30.  
  31.  
  32. $(main);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement