public void LogEventHandler(String commandId, String eventId, String handlerTypeName, Exception exception = null)
{
try
{
LogEventHandler(new EventHandlerRecord()
{
HandlerId = Guid.NewGuid().ToString(),
CommandId = commandId,
EventId = eventId,
EndedDate = DateTime.UtcNow,
ErrorMessage = exception == null ? "" : exception.Message,
ErrorStackTrace = exception == null ? "" : exception.ToString(),
TypeName = handlerTypeName
});
}
catch(Exception e)
{
// Catch all errors because logging should not throw errors if unsuccessful
}
}