public static void RollbackIfNecessary(RC.IModel channel, ILogger logger = null) { if (channel == null) { throw new ArgumentNullException(nameof(channel)); } try { channel.TxRollback(); } catch (Exception ex) { logger.LogError(ex, "Error during TxCommit"); throw RabbitExceptionTranslator.ConvertRabbitAccessException(ex); } }