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 (async () => { throw new Error("exception2") })()
     } catch (error) {
         console.log(`error: ${error.message}`)
    }


    })()