We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa46950 commit 4a793feCopy full SHA for 4a793fe
bin/wscat
@@ -198,8 +198,12 @@ if (program.listen && program.connect) {
198
ws.send(data, { mask: true });
199
wsConsole.prompt();
200
});
201
- }).on('close', function close() {
202
- wsConsole.print('disconnected', Console.Colors.Green);
+ }).on('close', function close(code, description) {
+ var msg = 'disconnected';
203
+ if (code != 1000) {
204
+ msg += ' with error ' + code + (description ? ': ' + description : '');
205
+ }
206
+ wsConsole.print(msg, Console.Colors.Green);
207
wsConsole.clear();
208
process.exit();
209
}).on('error', function error(code, description) {
0 commit comments