From 9d9af21791fc3f74c5165df850f943ef7a748b4e Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Sat, 18 Jan 2020 23:43:10 -0500
Subject: added new error case to socket.js
---
socket.js | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/socket.js b/socket.js
index aefc1c0..c165597 100644
--- a/socket.js
+++ b/socket.js
@@ -60,9 +60,8 @@ class Socket extends retryws {
}
this.write = function(chars){ //chars is an list of pairs [ pixel coordinate (y/x < 16), char ]
- if (chars.length > 200){
- throw "Too many characters to write by server decree";
- }
+ if (chars.length > 200) throw "Too many characters to write by server decree";
+ if (chars.length == 0) throw "Send at least a character.";
let write = [];
for (let cha of chars){
let coord = cha[0];
--
cgit