Open adborden opened 9 years ago
I'm confused by "handle the error twice", at least if all you are doing is using start, stop and increment() etc, flushing happens in the background and you're not handling it; the only way to handle errors in that case would be with .on('error')
I'd prefer if the worker didn't crash when Librato errored, or for the .on('error')
procedure to be highlighted in the README in big red letters.
Good point. I was thinking in the manual flush case, you get the error from the callback and the emitter.
If we decide to keep it, I agree that we should document it.
This one just bit me, there really needs to be documentation on this. Do i understand this correctly, if i have a
liberato.on('error', function() {});
I will no longer have uncaught errors when there are network issues?
Yeah, that's right. I just added this to the readme #46
thanks @adborden!
On Sun, Aug 9, 2015 at 7:19 PM, Aaron Borden notifications@github.com wrote:
Yeah, that's right. I just added this to the readme #46 https://github.com/goodeggs/librato-node/pull/46
— Reply to this email directly or view it on GitHub https://github.com/goodeggs/librato-node/issues/33#issuecomment-129279894 .
Bit me too....thanks @adborden for adding to the docs
We don't really document it, but librato-node extends EventEmitter and emits errors in addition to calling the callback.
This is a bit strange because:
There is only one place where we're actually using emit. Should we just drop the EventEmitter API?