primus icon indicating copy to clipboard operation
primus copied to clipboard

emit errors to spark

Open omnidan opened this issue 11 years ago • 1 comments

Right now, I have:

primus.on('connection', function connection(spark, next) {
  spark.on('error', function(err) { });
  next('handshake error');
}

The next function emits an error event to the spark, which I want to relay to the client.

Primus should support something similar to this: http://socket.io/docs/server-api/#namespace%23use(fn:function):namespace (Errors passed to middleware callbacks are sent as special error packets to clients.)

omnidan avatar Jul 27 '14 18:07 omnidan

+1

Maarethyu avatar Mar 12 '18 17:03 Maarethyu