mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-21 21:20:39 +02:00
removed swallowed exceptions
This commit is contained in:
parent
969bc00098
commit
110d1e6fbe
|
@ -148,6 +148,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -157,6 +159,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
|
@ -236,15 +236,19 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.ErrorException("Failed to save item:", e);
|
Logger.ErrorException("Failed to save items:", e);
|
||||||
|
|
||||||
if (transaction != null)
|
if (transaction != null)
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -439,15 +443,19 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.ErrorException("Failed to save item:", e);
|
Logger.ErrorException("Failed to save children:", e);
|
||||||
|
|
||||||
if (transaction != null)
|
if (transaction != null)
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
|
@ -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>
|
/// <summary>
|
||||||
/// Gets a stream from a DataReader at a given ordinal
|
/// Gets a stream from a DataReader at a given ordinal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -203,6 +203,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -212,6 +214,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
|
@ -145,6 +145,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -154,6 +156,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -228,7 +232,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
|
|
||||||
cmd.Transaction = transaction;
|
cmd.Transaction = transaction;
|
||||||
|
|
||||||
await ExecuteCommand(cmd).ConfigureAwait(false);
|
await cmd.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
|
@ -239,6 +243,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -248,6 +254,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue