diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-01-18 23:43:10 -0500 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-01-18 23:43:10 -0500 |
commit | 9d9af21791fc3f74c5165df850f943ef7a748b4e (patch) | |
tree | ad7c00df9e05e6e88def9cfc046474dd6e75b968 | |
parent | 7078cb41929b7babeeea0b912181feb2f544ebf5 (diff) |
added new error case to socket.js
-rw-r--r-- | socket.js | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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]; |