• I've got the following code running, deliberately without having an SD card in the slot, but the catch statement never seems to execute. Am I being stupid?

    I see ERROR: Unable to mount media : NOT_READY on the console but not caught an error. If I remove all my console.log, I still get ERROR: Unable to mount media : NOT_READY so I'm assuming it is being logged higher up the stack?

    SPI1.setup({ mosi: A7, miso: A6, sck: A5 });
    E.connectSDCard(SPI1, B1);
    
    var fs = require("fs");
    
    try {
      fs.readdirSync();
    } catch (err) {
      console.log('caught an error');
      console.log(err);
    }
    
About

Avatar for dave_irvine @dave_irvine started