From 5132019ce6473ea9a9e70ff95860019162937f55 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Mon, 2 Mar 2020 22:28:27 +0800 Subject: [PATCH] feat: add error handle Signed-off-by: MiaoWoo --- packages/client/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 104d91ee..10f0fe64 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -21,6 +21,10 @@ function createConnection(host: string, port: number, username: string) { return client; } +client.on('error', (error) => { + console.log("Client Error", error) +}) + client.on('end', (resone) => { console.log("Client End Resone:", resone) client = createConnection('192.168.2.5', 25577, username) @@ -48,6 +52,8 @@ rl.on('line', function (line) { switch (line) { case "": break; + case "eval": + break; case "write": break; case "/respawn":