ws-error
Create neat, nicely formatted errors for your websocket clients.
Example
; // 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.;
Error Types
Invalid Login badLogin
(Bad login information from the client)
Invalid Data invalidData
(Bad data sent by the client)
Closing closing
(Indicates the server is closing)