You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the keen .NET SDK and have just noticed a few errors popped up the other day in my .NET WEB API application. The error points back to the keenClient.AddEvent() function not completing, timing out or failing to connect.
I don’t mind if these events don’t make it to keen, I would prefer the API transaction to succeed and not get the stats, rather than have the process fall over because the API couldn't contact Keen. I just want to implement a "fire and forget" pattern.
So my question is:
Does the asynchronous version of AddEvent (I.e. KeenClient.AddEventAsync()) still cause exceptions if it cannot connect? Or should I just wrap the keenClient.AddEvent() call in a try/catch block and ignore the exception?
The text was updated successfully, but these errors were encountered:
Hey @Sbopf. I realize this is a really old issue, but wanted to address this.
If you aren't using an EventCache, AddEventAsync will immediately send your events using an HttpClient, and it will propagate any exceptions thrown back to your client, which will need to handle those exceptions.
I'd suggest the correct way to handle this situation is to wrap AddEventAsync with a try block and handle the specific exception you're trying to squelch. As you've seen, an unhandled exception is going to take down your app.
Hi Keen Team,
I use the keen .NET SDK and have just noticed a few errors popped up the other day in my .NET WEB API application. The error points back to the keenClient.AddEvent() function not completing, timing out or failing to connect.
I don’t mind if these events don’t make it to keen, I would prefer the API transaction to succeed and not get the stats, rather than have the process fall over because the API couldn't contact Keen. I just want to implement a "fire and forget" pattern.
So my question is:
Does the asynchronous version of AddEvent (I.e. KeenClient.AddEventAsync()) still cause exceptions if it cannot connect? Or should I just wrap the keenClient.AddEvent() call in a try/catch block and ignore the exception?
The text was updated successfully, but these errors were encountered: