Skip to content
Browse files

Add some documentation about error handling

  • Loading branch information...
1 parent ddf0507 commit edddf1c3f488dde1c097845b418e575b72a040c8 @martynsmith committed Oct 26, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 README.rst
19 README.rst
@@ -75,6 +75,24 @@ which sends raw messages to the server::
client.send('MODE', '#yourchannel', '+o', 'yournick');
+Help! - it keeps crashing!
+When the client receives errors from the IRC network, it emits an "error"
+event. As stated in the `Node JS EventEmitter documentation`_ if you don't bind
+something to this error, it will cause a fatal stack trace.
+The upshot of this is basically that if you bind an error handler to your
+client, errors will be sent there instead of crashing your program.
+ client.addListener('error', function(message) {
+ console.log('error: ', message);
+ });
+Further Documentation
Further documentation (including a complete API reference) are available in
reStructuredText format in the docs/ folder of this project, or online at `Read the Docs`_.
@@ -84,3 +102,4 @@ request or file an issue and I'll do my best to accommodate.
.. _npm:
.. _here:
.. _`Read the Docs`:
+.. _`Node JS EventEmitter documentation`:

0 comments on commit edddf1c

Please sign in to comment.
Something went wrong with that request. Please try again.