mixpanel-data-export-js icon indicating copy to clipboard operation
mixpanel-data-export-js copied to clipboard

Rate limit errors not trapped correctly?

Open GeoffreyPlitt opened this issue 6 years ago • 8 comments

I'm checking data.error correctly, but I still see console.log's with the following error when I query too often with the raw datapoint export:

Oct 18 15:25:46 stardust-backend app/misc_workers3.1:  undefined:1 
Oct 18 15:25:46 stardust-backend app/misc_workers3.1:  [rate limit reached] 
Oct 18 15:25:46 stardust-backend app/misc_workers3.1:   ^ 
Oct 18 15:25:46 stardust-backend app/misc_workers3.1:  SyntaxError: Unexpected token r in JSON at position 1 
Oct 18 15:25:46 stardust-backend app/misc_workers3.1:      at Object.parse (native) 

A few problems:

  • Something is JSON.parse'ing non JSON data
  • This error is then not trapped correctly, it's console-logged but my error checking doesn't catch it.

GeoffreyPlitt avatar Oct 18 '18 22:10 GeoffreyPlitt

@michaelcarter

GeoffreyPlitt avatar Oct 23 '18 18:10 GeoffreyPlitt

@michaelcarter Is this repo maintained at all? Can anyone else help? If you're busy, can you point me in the right direction to fix it?

GeoffreyPlitt avatar Oct 29 '18 18:10 GeoffreyPlitt

@geoffreyplitt I’ll try to have a look tomorrow.

michaelcarter avatar Oct 29 '18 19:10 michaelcarter

Sorry for the delay @GeoffreyPlitt, life getting in the way. Having a look at this now.

michaelcarter avatar Nov 01 '18 16:11 michaelcarter

Thanks!

GeoffreyPlitt avatar Nov 01 '18 16:11 GeoffreyPlitt

Ok, @GeoffreyPlitt. I was able to recreate your problem locally and I think this branch should fix it for you. Perhaps you could give it a try and let me know?

I've not touched this library in long while, and just about everything is in need of an update. When I next get a free day I'll fix all that up. But if this solves your problem in the mean time I'll get out a bugfix release for you.

michaelcarter avatar Nov 01 '18 17:11 michaelcarter

Cool, updated my code, which will run several times overnight, will let you know tomm.

GeoffreyPlitt avatar Nov 01 '18 23:11 GeoffreyPlitt

Looks good to me! I'll watch for the merge and update my package. Thanks again Michael.

GeoffreyPlitt avatar Nov 02 '18 17:11 GeoffreyPlitt