Work in progress: don't stop processing incoming messages if an error occurs; allow both string and object parameters to the first argument of .on().
Add `receive_error` and `transmit_error` events.