mixpanel-data-export-js
mixpanel-data-export-js copied to clipboard
Rate limit errors not trapped correctly?
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.
@michaelcarter
@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 I’ll try to have a look tomorrow.
Sorry for the delay @GeoffreyPlitt, life getting in the way. Having a look at this now.
Thanks!
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.
Cool, updated my code, which will run several times overnight, will let you know tomm.
Looks good to me! I'll watch for the merge and update my package. Thanks again Michael.