dashersw/cote

What about error handling?

dreambit opened this issue · 1 comments

Hi, i did not find any docs on error handling

timeService.on('time', (req, cb) => {
// some error
// how to return error
cb(new Error());
});

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.