Make sure to return on rejection.

This commit is contained in:
Daniel Scalzi 2020-08-28 17:39:29 -04:00
parent e76eb91ac9
commit dbc49f51dd
No known key found for this signature in database
GPG Key ID: D18EA3FB4B142A57
3 changed files with 5 additions and 4 deletions

6
package-lock.json generated
View File

@ -7698,9 +7698,9 @@
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
},
"mocha": {
"version": "8.1.2",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.2.tgz",
"integrity": "sha512-I8FRAcuACNMLQn3lS4qeWLxXqLvGf6r2CaLstDpZmMUUSmvW6Cnm1AuHxgbc7ctZVRcfwspCRbDHymPsi3dkJw==",
"version": "8.1.3",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.3.tgz",
"integrity": "sha512-ZbaYib4hT4PpF4bdSO2DohooKXIn4lDeiYqB+vTmCdr6l2woW0b6H3pf5x4sM5nwQMru9RvjjHYWVGltR50ZBw==",
"dev": true,
"requires": {
"ansi-colors": "4.1.1",

View File

@ -79,7 +79,7 @@
"eslint": "^7.7.0",
"eslint-plugin-react": "^7.20.6",
"helios-distribution-types": "1.0.0-pre.1",
"mocha": "^8.1.2",
"mocha": "^8.1.3",
"nock": "^13.0.4",
"react": "^16.13.0",
"react-dom": "^16.13.0",

View File

@ -123,6 +123,7 @@ export function getServerStatus(protocol: number, address: string, port = 25565)
if(iterations > maxTries) {
socket.destroy()
reject(new Error(`Data read from ${address}:${port} exceeded ${maxTries} iterations, closing connection.`))
return
}
++iterations