builder-247 / node-autotip

Commandline-based autotip client for Hypixel using mineflayer
MIT License
20 stars 6 forks source link

When internet connection is interrupted via some routers, the program crashes. #15

Closed Moire9 closed 4 years ago

Moire9 commented 4 years ago

My parents have my internet set to automatically turn off at 21:00. However, this is not what you think. Instead of it turning off, instead, all requests are intercepted and sent to a random xfinity 404 page, essentially blocking communication between client and server. However, this causes an error in node-at.

/mnt/d/Users/SirNapkin1334/Desktop/node-autotip-mod/node_modules/yggdrasil/lib/utils.js:23
    if (resp.body.length === 0) {
             ^

TypeError: Cannot read property 'body' of null
    at /mnt/d/Users/SirNapkin1334/Desktop/node-autotip-mod/node_modules/yggdrasil/lib/utils.js:23:14
    at ClientRequest.<anonymous> (/mnt/d/Users/SirNapkin1334/Desktop/node-autotip-mod/node_modules/phin/lib/phin.compiled.js:1:2551)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-autotip@2.1.3 start: `node index`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-autotip@2.1.3 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sirnapkin1334/.npm/_logs/2020-05-05T04_21_00_075Z-debug.log

Also, the ability to change the node-at log location, perhaps via .env, would be nice, as accessing the home directory from Windows on WSL is slightly inconvenient, and IMO it would make more sense to have the logs in the node-at folder. Anyways, here is the log: 2020-05-05T04_21_00_075Z-debug.log

builder-247 commented 4 years ago

This is not an issue with node-autotip, but with the authentication library yggdrasil.

Also, the ability to change the node-at log location, perhaps via .env, would be nice

That's npm logs, node-autotip's own logs get stored in ./logs

Moire9 commented 4 years ago

Alright, I will report this there then. Sorry fort he inconvenience.