-
Notifications
You must be signed in to change notification settings - Fork 166
exception handling #17
Comments
for now, i found sort of a way to do it:
only problem is, node prints stacktraces and I can't find how to disable it. # edit, this seems to have magically fixed itself. |
it may be useful to make the client itself an event emitter, this way the user doesn't need to have the knowledge of "socket" and we can emit our own events/errors if need be. |
the new version adds the ability to provide a callback to each method. the callback returns an error if the message was not sent and returns the number of bytes sent if it was. This has been documented in the readme. Any other socket exceptions are bubbled up and the user can add a listener to it if they please. |
* remove logging from library, it's up to the implementing app. * expose socket in Client.socket for listening on 'error' events This commit should be treated as experimental, I spent some time figuring out a good way to do things, but i'm still a node newbie. Open for discussion @ sivy#17
I would try to implement the following exception policy in node-statsd:
I'm thinking of the following issues:
require('dgram').createSocket('udp4')
can raise errors, andsocket.send()
as well.I'm new to node.js exception handling, so any input is welcome. For now I'm just tinkering and trying to find a workable solution, but I haven't figured it out yet. cc @msiebuhr
The text was updated successfully, but these errors were encountered: