Created
          March 11, 2018 17:42 
        
      - 
      
 - 
        
Save liseferguson/cd920df3d2700546cc6edbd8e17d5c94 to your computer and use it in GitHub Desktop.  
    Error message drill
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function main() { | |
| try { | |
| doAllTheThings(); | |
| } | |
| catch(err) { | |
| console.error(err); | |
| reportError(err); | |
| } | |
| } | |
| 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); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
https://repl.it/@liseferguson/Error-alert-drill