I am using socketcluster for an application of mine. I have implemented middleware authentication and authorization for the socket events, by chaining callback functions.
In case of any error generated from the middleware, I need to send errors to my client with custom messages. I couldn't find any functionality in socketcluster documentation to implement that.
Now, if this isn't possible to implement, are there any inbuilt socketcluster errors that can be invoked from the middleware in socketcluster server? If there are, is there any exhaustive list of that?
Any help would be much appreciated...
P.S: I looked at the socketcluster source from their github repo. Looks like they use another project called sc-errors. Is it possible to include it in my own project and use the errors defined in them?
Solved it.
Just propagated the error object with "name" and "message" parameters, in the middleware. Also, had to upgrade my socketcluster to latest version.