Closed zvin closed 7 years ago
The 'error' event is not emitted when init fails.
Here is a simple test case:
const fatfs = require('fatfs') const fat = fatfs.createFileSystem({ sectorSize: 512, numSectors: 1000, readSectors: function(sector, dest, callback) { // read always returns zeros callback(null, Buffer.alloc(dest.length)); }, writeSectors: function(sector, data, callback) { callback(null, data.length) } }); fat.on('error', function(err) { console.log('err', err) }) fat.on('ready', function() { console.log('ready') })
I would expect this code to output 'err' followed by the actual error. Instead it just prints the error and exits.
This PR fixes it.
Thanks, good catch! Published as fatfs@0.10.6 on npm.
fatfs@0.10.6
Thank you for the quick merge.
The 'error' event is not emitted when init fails.
Here is a simple test case:
I would expect this code to output 'err' followed by the actual error. Instead it just prints the error and exits.
This PR fixes it.