Closed austinnguyen01 closed 6 years ago
The "u" comes from the return of "undefined" I simply made an "if" statement to prevent the bot from crashing. I will send you the snippet when Im back at home later today :)
It's due to a response from the VGO api, like @creazy231 stated just check the response is okay to prevent the crash.
SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse ()
at Request.request.get [as _callback] (C:\coding\htdocs\bot\libs\helpers\request.js:28:44)
at self.callback (C:\coding\htdocs\bot\node_modules\request\request.js:185:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at Request.onRequestError (C:\coding\htdocs\bot\node_modules\request\request.js:877:8)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
The bot crashes randomly with this sometimes anyone have a fix?