Skip to content

Commit

Permalink
new fake channel for error and system output and fix bug associate ch…
Browse files Browse the repository at this point in the history
…annel
  • Loading branch information
iRyusa committed Nov 15, 2011
1 parent d2ba0e8 commit 1076504
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/hornet_server.js
Expand Up @@ -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"
};
Expand All @@ -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"
};
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 1076504

Please sign in to comment.