Catching exceptions when using BufferedProcess


#1

Is there a decent way to catch exceptions raised when using BufferedProcess?

If the command to run isn’t available, node will emit an ENOENT event. If I use spawn directly I’ve got great control over this.

With BufferedProcess, the only thought I have is to use an instance’s process attribute directly:

@bufferedProcess = new BufferedProcess({command, args, options, stdout, stderr, exit})
@bufferedProcess.process.on('error', (node_error) ->
      console.log(node_error, "Totally useful error message")
)

I’m pretty new to node here, so I’m open to any best practices you all have.