Permalink
Browse files

Stop showing unnecessary word 'undefined'

  • Loading branch information...
1 parent 904e0b2 commit 0652bb3a33e67099b8dc9d83d441fe347102b12c @tricknotes tricknotes committed Jun 9, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 bin/wscat
View
@@ -133,7 +133,7 @@ else if (program.listen) {
ws = null;
});
ws.on('error', function(code, description) {
- wsConsole.print('error: ' + code + ' ' + description, Console.Colors.Yellow);
+ wsConsole.print('error: ' + code + (description ? ' ' + description : ''), Console.Colors.Yellow);
});
ws.on('message', function(data, flags) {
wsConsole.print('< ' + data, Console.Colors.Blue);
@@ -163,7 +163,7 @@ else if (program.connect) {
process.exit();
});
ws.on('error', function(code, description) {
- wsConsole.print('error: ' + code + ' ' + description, Console.Colors.Yellow);
+ wsConsole.print('error: ' + code + (description ? ' ' + description : ''), Console.Colors.Yellow);
process.exit(-1);
});
ws.on('message', function(data, flags) {

0 comments on commit 0652bb3

Please sign in to comment.