james-henderson/chord — pull request #16 by charles-dyfis-net (2014-05-02 18:47:21+00:00)
Title: #6: Fix up error handling

- Before make-open-ch has yielded a read channel, use initial `onerror` and `onclose` handlers which act via the channel-delivery channel. Allow make-open-ch to be passed a callback used to set up final handlers.
- Do not assume that on-error will return an event with a `data` attribute. This attribute is not guaranteed to exist by the W3 spec for WebSockets. Instead, defer error delivery until `onclose()` is called, which is guaranteed by spec to have `reason` and `code` attributes.
- Do not assume that put! will act synchronously.