Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not throw error on cancelled session #222

Closed
domnantas opened this issue Nov 26, 2021 · 2 comments
Closed

Do not throw error on cancelled session #222

domnantas opened this issue Nov 26, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request tracker

Comments

@domnantas
Copy link

I have reduced the session capture rate to 5%. That means 95% of users are not tracked, but they get this in console:
image

This seems odd, because I think this cancelling is intended, therefore not an error. This piece of code causes the error:

} else { // TODO: handle canceling && 403
return r.text().then(text => {
throw new Error(`Server error: ${r.status}. ${text}`);
});
}

@PandaCodes
Copy link
Contributor

@domnantas indeed, you mentioned in the pr the reasons why I didn't do it instantly. Please, find the promise solution in the version 3.4.9 - the tracker.start() returns a promise from this moment, and canceling/errors could be handled with .catch. (Still not sure it is the best solution though)
Thanks for kicking me with this contribution!

@domnantas
Copy link
Author

I still see 403 and errors being thrown in the console with reduced capture rate
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tracker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants