miasmos / op.gg-api

Serves op.gg web pages as json.
MIT License
81 stars 22 forks source link

Error: Invalid summoner name. #11

Closed twardle closed 7 years ago

twardle commented 7 years ago

while debugging I noticed I kept getting the following error:

{ Error: Invalid summoner name.
    at ErrorExtended (C:\Users\Tyler\workspace\javascript\node_modules\op.gg-api\lib\Responses\Error.js:4:3)
    at SummaryNormal.Promise (C:\Users\Tyler\workspace\javascript\node_modules\op.gg-api\client.js:151:48)
    at Promise._execute (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\debuggability.js:300:9)
    at Promise._resolveFromExecutor (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\promise.js:483:18)
    at new Promise (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\promise.js:79:10)
    at opgg.SummaryNormal (C:\Users\Tyler\workspace\javascript\node_modules\op.gg-api\client.js:149:14)
    at getData (C:\Users\Tyler\workspace\javascript\index.js:44:22)
    at getNeighbors (C:\Users\Tyler\workspace\javascript\index.js:106:4)
    at opgg.SummaryNormal.catch.then.error (C:\Users\Tyler\workspace\javascript\index.js:71:5)
    at tryCatcher (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\promise.js:693:18)
    at Async._drainQueue (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\Users\Tyler\workspace\javascript\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5) code: 400 }

The names that cause it seem to be pretty arbitrary, some contain spaces which throw the error while others that have a space search without a problem. Special characters also seem to be arbitrarily causing this.

I've tried escaping all regular expression characters and that doesn't seem to work either. As you can see, the list of names that throw the invalid summoner name seems a little arbitrary.

A short list of names causing this error:

PrtyPinkPrincess AirMarshal50Cent RiotMustachinato Cptn+JakeSparrow ÉFX ReadyForSumSalad Tentative+Toucan MajTom2GrndCntrl Cautious+Ostrich tugginonmypuddin

Long list of names checked:

miasmos commented 7 years ago

Arbitrary, you say?

twardle commented 7 years ago

Oh, I see. thanks for the quick fix.