• Hmm, I don't think you're doing anything wrong. That looks like a bug to me... For instance this will work:

    function outer() {
     try {
       console.log('In outer');
       inner();
       console.log('Out outer');
     } catch(x) {
       console.log('Catch outer');
     }
    }
    function inner() {
     var caught;
     try {
       console.log('In inner');
       throw "coucou";
       console.log('Out inner');
     } catch(x) {
       console.log('Catch inner'+x);
       caught = x;
     }
     if (caught) throw caught;
    }
    
    outer();
    

    I'll make sure I put that in the bug tracker.

    To be honest I don't think people generally use exceptions much with Espruino, so it probably hasn't come up before.

About

Avatar for Gordon @Gordon started