Create neat, nicely formatted errors for your websocket clients.
;// Create an error to play around with;// Some attributes can be set after the fact.// Errors can optionally have error codeserror.code123;// Errors can also have custom meta set after the fact.error.extra;// These calls are chainable tooerror.code123.extra;// Finally, you can turn this into JSON, or a string.console.logerror.json;console.logerror.string;// All errors have default messages that go along with them, but you can override these.;
badLogin (Bad login information from the client)
invalidData (Bad data sent by the client)
closing (Indicates the server is closing)