7.3 Error handling

by dimitrs_papadimitriou

HTML

<script src="https://rawgit.com/eu81273/jsfiddle-console/master/console.js"></script>

JavaScript

(async()=>{ // this is just because all awaits should be in async functions
        
 try {
         var result = await Promise.reject(new Error("exception1"))
     } catch (error) {
         console.log(`error: ${error.message}`)
    }


    })()