SocketCluster / socketcluster-client

JavaScript client for SocketCluster
MIT License
292 stars 91 forks source link

Unable to intercept error #21

Closed mvaullerin closed 8 years ago

mvaullerin commented 8 years ago

Hi,

When I send back an error from my server after an emit like this :

socket.on('login', function(data, res){
  if(login.status == "fail"){
    res('incorrect email');
  }
}

I get this kind of message in my chrome console :

Uncaught incorrect email

Is there any way to catch the error ?

PS : I'm on SC1

jondubois commented 8 years ago

Did you try adding an error handler on the client socket.on('error', function () {...});?

mvaullerin commented 8 years ago

Ok, it's easiest as that...

Thanks for the quick response ! :)