Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

new fake channel for error and system output and fix bug associate ch…

…annel
  • Loading branch information...
commit 107650439ec2eac223fd5e402614cafd8b09fa7c 1 parent d2ba0e8
@iRyusa iRyusa authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/hornet_server.js
View
5 lib/hornet_server.js
@@ -33,6 +33,7 @@ var handleConnection = function( rawMessage ) {
var msg = {
type: "error",
+ channel: "hornet",
error: "WRONG_PARAMETERS",
errorMsg: "Client connection error: Wrong parameters. You should connect to hornet specifying channel and hornetToken parameters"
};
@@ -52,6 +53,7 @@ var handleConnection = function( rawMessage ) {
if (exists != 1) {
var msg = {
type: "error",
+ channel: "hornet",
error: "INVALID_TOKEN",
errorMsg : "Invalid token used, please get a new token"
};
@@ -99,11 +101,12 @@ var handleConnection = function( rawMessage ) {
var msg = {
type: "error",
+ channel: "hornet",
error: "WRONG_TOKEN_ASSOCIATION",
errorMsg : "Connection error : unauthorized access"
};
- socket.send( msg );
+ socket.send( JSON.stringify(msg) );
// TODO : maybe we should consider logging more data about the client here...
utils.log('Client connection error: token:' + token + ' not associated to channel:' + wrongChannel );
Please sign in to comment.
Something went wrong with that request. Please try again.