-
Notifications
You must be signed in to change notification settings - Fork 37
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
Lack of fail over for emitters. #50
Comments
Have you looked at the SyncEmitter? https://github.com/snowplow/snowplow-php-tracker/blob/master/src/Emitters/SyncEmitter.php |
I'm afraid I did. What is needed is: if (!$trucker->trackUnstructEvent($json, $context, $timestamp)) { or even better: try { print_r(sprintf('%s - %s', "This is what went wrong: ", $e->getMessage())) This: $debug parameter inside SyncEmitter::__construct( whatever here, $debug) should be removed. I do not see any added value from having debugger as part of code going on production. |
Thanks for the feedback - scheduled! |
I've just been looking into how to gracefully handle failures when using POST and buffer size/batch of 50 events on 0.3.1. Looks like I could so something like and do something if the result != true But then I won't be able to reset the buffer... so any more events I add via track() will cause a flushEvents to trigger and send the events again.
I think that if |
Hello @brenton-vidcorp and @smentek ! Thank you very much for your feedback! |
Lets say I want to track unstructEvent link:
$trucker->trackUnstructEvent($json, $context, $timestamp);
Now let say I want to do some actions in case it fails. There is no way to do that.
Nothing. The same for all other calls.
It is like speed would be all we care about here and reliability is nothing.
But if speed is what we are focus on should we even write it in PHP? I would prefer slow but readable and safe solution...
After adding Exceptions please remove all 'print_r' from code. What do do with error messages that would be properly set in exceptions should be part of application that uses snowplow-tracker.
The text was updated successfully, but these errors were encountered: