Advertisement
Guest User

Untitled

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