Closed twardle closed 7 years ago
Everything seems to be working perfectly now. Not getting any errors, I'll let you know if I run into anything else but thank you very much for all quick responses and fixes.
No problem. Enjoy.
On Mon, May 15, 2017 at 3:10 PM, twardle notifications@github.com wrote:
Everything seems to be working perfectly now. Not getting any errors, I'll let you know if I run into anything else but thank you very much for all quick responses and fixes.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/stephenpoole/op.gg-api/issues/12#issuecomment-301573999, or mute the thread https://github.com/notifications/unsubscribe-auth/ADMHH2CJSZz_qKC9hHtdP-Tz89lj8ncJks5r6KMPgaJpZM4NbgjM .
I have a question, but what is the best way to wait for a response from your API? I'm new to javascript, so I've been trying to do research on appropriately using callbacks to appropriately handle errors and resending requests that time out. Generally, this only happens when I attempt to send more than 500 requests.
{ RequestError: Error: connect ETIMEDOUT 54.175.33.199:80
at new RequestError (C:\Users\Tyler\workspace\javascript\node_modules\request-promise-core\lib\errors.js:14:15)
at Request.plumbing.callback (C:\Users\Tyler\workspace\javascript\node_modules\request-promise-core\lib\plumbing.js:87:29)
at Request.RP$callback [as _callback] (C:\Users\Tyler\workspace\javascript\node_modules\request-promise-core\lib\plumbing.js:46:31)
at self.callback (C:\Users\Tyler\workspace\javascript\node_modules\request\request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (C:\Users\Tyler\workspace\javascript\node_modules\request\request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:309:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
name: 'RequestError',
message: 'Error: connect ETIMEDOUT 54.175.33.199:80',
cause:
{ Error: connect ETIMEDOUT 54.175.33.199:80
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: '54.175.33.199',
port: 80 },
error:
{ Error: connect ETIMEDOUT 54.175.33.199:80
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: '54.175.33.199',
port: 80 },
options:
{ headers:
{ 'Content-Type': 'text/html',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36',
'Accept-Language': 'en-GB,en-US;q=0.8,en;q=0.6' },
uri: 'http://na.op.gg/summoner/?userName=HoneyDewMelons&',
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false },
response: undefined }
This is the actual error that I'm receiving and I'm under the assumption it has to do with the volume of requests I'm sending without getting a response. I've attempted to bodge a solution by just adding a wait function; however, this doesn't do anything other than just bog down the code (expected this, but it was worth a shot).
This is outside the scope of this project, but I can point you in the right direction. Generally, you want to use a limiter of some sort. Many exist, but the one I usually use is here: https://www.npmjs.com/package/bottleneck
Make sure you're handling errors gracefully as well, as a request can sometimes fail even if you're not being rate limited.
Thanks, that's all I was looking for.
So, I'm thinking I'm getting this error:
Whenever a summoner name includes a special character, i.e. "ƒiøra"
While Riot doesn't allow new users to create names with special characters, many long term users are still allowed to have these characters in their names until they do a name change. These users definitely exist and I can look them up with the special characters in their name on op.gg without any issues. Any ideas what might be causing this, or is this just a validation check in the API that corresponds to Riot's new naming conventions?