public void OnAfterExecuteCommand(IDbCommand command, string executeMethod, bool isAsync, Exception exception) { var timing = _broker.EndLogicalOperation<BeforeExecuteCommandMessage>(); if (timing != null) { var message = new AfterExecuteCommandExceptionMessage { //Exception = exception, CommandHadException = true, CommandDuration = timing.Elapsed, CommandEndTime = timing.End, CommandOffset = timing.Offset }; _broker.SendMessage(message); } else { _logger.LogCritical("OnAfterExecuteCommand: Couldn't publish `AfterExecuteCommandExceptionMessage` as `BeforeExecuteCommandMessage` wasn't found in stack"); } }
public void OnAfterExecuteCommand(IDbCommand command, string executeMethod, bool isAsync, Exception exception) { var timing = _broker.EndLogicalOperation <BeforeExecuteCommandMessage>(); if (timing != null) { var message = new AfterExecuteCommandExceptionMessage { //Exception = exception, CommandHadException = true, CommandDuration = timing.Elapsed, CommandEndTime = timing.End, CommandOffset = timing.Offset }; _broker.SendMessage(message); } else { _logger.LogCritical("OnAfterExecuteCommand: Couldn't publish `AfterExecuteCommandExceptionMessage` as `BeforeExecuteCommandMessage` wasn't found in stack"); } }