doc: clarify child_process error behaviour
authorLinus Unnebäck <linus@folkdatorn.se>
Thu, 21 Nov 2013 15:39:23 +0000 (16:39 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Sat, 23 Nov 2013 14:46:50 +0000 (15:46 +0100)
Clarify that an 'error' event may or may not be followed by an 'exit'
event and that it's not safe to make assumptions either way.

doc/api/child_process.markdown

index d21f7db..40cd183 100644 (file)
@@ -36,6 +36,10 @@ Emitted when:
 2. The process could not be killed, or
 3. Sending a message to the child process failed for whatever reason.
 
+Note that the `exit`-event may or may not fire after an error has occured. If
+you are listening on both events to fire a function, remember to guard against
+calling your function twice.
+
 See also [`ChildProcess#kill()`](#child_process_child_kill_signal) and
 [`ChildProcess#send()`](#child_process_child_send_message_sendhandle).