aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-01-18 23:43:10 -0500
committerHolden Rohrer <hr@hrhr.dev>2020-01-18 23:43:10 -0500
commit9d9af21791fc3f74c5165df850f943ef7a748b4e (patch)
treead7c00df9e05e6e88def9cfc046474dd6e75b968
parent7078cb41929b7babeeea0b912181feb2f544ebf5 (diff)
added new error case to socket.js
-rw-r--r--socket.js5
1 files 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];