What about error handling?
dreambit opened this issue · 1 comments
dreambit commented
Hi, i did not find any docs on error handling
timeService.on('time', (req, cb) => {
// some error
// how to return error
cb(new Error());
});
dashersw commented
If you are using callbacks, you can use any convention for errors (usually, first argument in responses becomes error, and the way you did it is right) and if you are using promises / async await, throwing errors just works.