summaryrefslogtreecommitdiff
path: root/std/ws/example_client.ts
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2020-02-17 19:49:30 +0200
committerGitHub <noreply@github.com>2020-02-17 12:49:30 -0500
commit19080667534954ac75caa1bcf34e3a55d5d55e4c (patch)
tree9750fd01b45824c650300f69fb6415e117dcea2e /std/ws/example_client.ts
parent2e7d449623b7faee8feb0a2970e0d6bb7c66b409 (diff)
Update ws client example (#4012)
Diffstat (limited to 'std/ws/example_client.ts')
-rw-r--r--std/ws/example_client.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/std/ws/example_client.ts b/std/ws/example_client.ts
index d5c5f3058..53b1a4ed5 100644
--- a/std/ws/example_client.ts
+++ b/std/ws/example_client.ts
@@ -30,9 +30,8 @@ console.log(green("ws connected! (type 'close' to quit)"));
const tpr = new TextProtoReader(new BufReader(Deno.stdin));
while (true) {
await Deno.stdout.write(encode("> "));
- const [line, err] = await tpr.readLine();
- if (err) {
- console.error(red(`failed to read line from stdin: ${err}`));
+ const line = await tpr.readLine();
+ if (line === Deno.EOF) {
break;
}
if (line === "close") {