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

Warning! Will throw fatal error if experiments ends #13

Open
alexcroox opened this issue Jul 5, 2017 · 0 comments
Open

Warning! Will throw fatal error if experiments ends #13

alexcroox opened this issue Jul 5, 2017 · 0 comments

Comments

@alexcroox
Copy link

alexcroox commented Jul 5, 2017

This caught me off guard in the early hours of this morning, 4 hours of downtime because this library throws a fatal error when the experiment ends and can't be found. Recommended fix is wrapping calls in try/catch

try {
    $experiment = new GoogleAnalytics\Experiment('xxxx');
    $variation = $experiment->chooseVariation();
} catch(Exception $e) {
   $variation = 1;
}
@alexcroox alexcroox changed the title Warning! Will fatal error if experiments ends Warning! Will throw fatal error if experiments ends Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant