node-sync
node-sync copied to clipboard
Thrown errors are silent
I'm not shure that it is actualy an issue but when I throw an exception I'm expecting it to be visible in the console output.
Here is a example code I run on node 5.1.0
'use strict'
let Sync = require('sync');
Sync(function(){
throw 'error';
});
It does not print anything
try this instead:
'use strict'
let Sync = require('sync');
Sync(function(){
throw 'error';
}, function(err, result) {
if (err) return console.error('Error: ', err);
console.log('Result: ', result);
});
I added pull-request. https://github.com/ybogdanov/node-sync/pull/53 Not sure why that line was commented, may be there is some reason, but now it works good for me.