optimizely/csharp-sdk

HttpClientEventDispatcher45 doesn't log full exception

ryandle opened this issue · 2 comments

The following exception handling code in HttpClientEventDispatcher45 only logs the message:

catch (Exception ex)
{
    Logger.Log(LogLevel.ERROR, string.Format("Error Dispatching Event: {0}", ex.Message));
}

Which results in logs like this:

Error Dispatching Event: An error occurred while sending the request.

There is probably a more helpful inner exception that is missing because only ex.Message is being logged.

I think this code should log ex.ToString() instead so that we get the inner exception details.

Thanks for submitting this! We will look into it.