maxogden/multiplex — pull request #2 by 1N50MN14 (2014-03-13 15:54:35+00:00)
Title: added optional onFromatError

Given:

```
var s = MyDummyStream // not a plexed stream
var p = multiplex(function onStream(stream, id) {})
s.pipe(p)
```

The following would throw an error and break multiplex (obviously because s is not plexed):
```
s.write('some troll is trying to do some flooding')
```
As a developer one deserves multiplex to crash in this case but when used along WebsocketStream anyone sending any dummy data would cause multiplex to throw an error.

This pull adds an optional onFormatErr callback which is triggered whenever the above happens.

added optional onFormatError if non multiplex compliant data is received on the other end