Guest User

Untitled

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