removed swallowed exceptions

This commit is contained in:
Luke Pulverenti
2013-05-28 13:32:50 -04:00
parent 969bc00098
commit 110d1e6fbe
5 changed files with 27 additions and 35 deletions

View File

@@ -151,38 +151,6 @@ namespace MediaBrowser.Server.Implementations.Sqlite
}
}
/// <summary>
/// Executes the command.
/// </summary>
/// <param name="cmd">The CMD.</param>
/// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException">cmd</exception>
public async Task ExecuteCommand(DbCommand cmd)
{
if (cmd == null)
{
throw new ArgumentNullException("cmd");
}
using (var tran = Connection.BeginTransaction())
{
try
{
cmd.Connection = Connection;
cmd.Transaction = tran;
await cmd.ExecuteNonQueryAsync().ConfigureAwait(false);
tran.Commit();
}
catch (Exception e)
{
Logger.ErrorException("Failed to commit transaction.", e);
tran.Rollback();
}
}
}
/// <summary>
/// Gets a stream from a DataReader at a given ordinal
/// </summary>