pokego-scan icon indicating copy to clipboard operation
pokego-scan copied to clipboard

createScanJob doesn't catch

Open Rigaudon opened this issue 8 years ago • 2 comments

As is, in the try block in createScanJob, parsing a json that has a status of "error" with a message of (for example) "{scan-throttle}" will not be caught, but instead passed as that json object to next().

In other words, if a user gets a scan-throttle error, then in this function, it will successfully parse the json in the try block as {"status":"error","message":"{scan-throttle}"} and call next with a null err, which is not the intended behavior. It should be caught in the block after the try.

Rigaudon avatar Jul 24 '16 03:07 Rigaudon

Hey, thanks, I've actually haven't been able to test that case, since I haven't seen that error happen. I copied those error checks from the web's javascript.

Have you actually seen that error with the format {"status":"error","message":"{scan-throttle}"}?

I'm changing the error handling to cover better that cases.

dgoguerra avatar Jul 24 '16 13:07 dgoguerra

Yeah, I've been trying to use your api and calling pokegoScan in a function several times. I believe the rate limit is once every 30 seconds? In any case, when I get rate limited, instead of telling me that I was sending too many requests, it was caught by the generic error "Unable to scan for pokemon.."

Rigaudon avatar Jul 24 '16 14:07 Rigaudon