-
Notifications
You must be signed in to change notification settings - Fork 39
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
Feature: event system and impression data events #113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty cool, just a small question about error handling but looks pretty darn good to me
callback(evtConfig); | ||
EventConfig = evtConfig; | ||
} | ||
catch (Exception ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something that can be raised here? This looks pretty harmless to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular one is probably very harmless, it's the callback where you configure all the handlers for the various events. But anything started in here that fails on a file lock or whatever will crash the startup of Unleash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can stand by that!
Variant = variant | ||
}); | ||
} | ||
catch (Exception ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, I can't see an obvious exception that could be caught here, is this just being defensive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I'm trapping event emitting, if your logger fails for some reason for instance, that won't crash harder than an error in the log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can live with that, seems polite to log an error if something super unexpected happens here
Thanks @sighphyre for review and questions. I've attempted a few more details in response. Perhaps this is a code area that could do with some comments 🤔 I'm trapping exceptions here since these two callbacks are code coming from outside Unleash, but I'm open for anything :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Description
Aims to add an event system to the SDK and a first implementation for impression data/events: https://docs.getunleash.io/advanced/impression-data#impression-event-data
Fixes # (issue)
#108
Type of change
How Has This Been Tested?
Checklist: