Ignore harmless constraint failures

This commit is contained in:
Timothy Baldridge 2021-01-05 15:53:26 -07:00
parent 13eef5c695
commit da521ba3c0

View File

@ -52,9 +52,15 @@ namespace Wabbajack.Common
cmd.Parameters.AddWithValue("@patchSize", patch.Length);
cmd.Parameters.AddWithValue("@patch", patch.ToArray());
try
{
await cmd.ExecuteNonQueryAsync();
}
catch (SQLiteException ex)
{
if (!ex.Message.StartsWith("constraint exception"))
throw;
}
await patch.CopyToAsync(output);
}
@ -78,7 +84,16 @@ namespace Wabbajack.Common
cmd.Parameters.AddWithValue("@patchSize", patchStream.Length);
cmd.Parameters.AddWithValue("@patch", patchStream.ToArray());
try
{
await cmd.ExecuteNonQueryAsync();
}
catch (SQLiteException ex)
{
if (!ex.Message.StartsWith("constraint exception"))
throw;
}
if (patchOutStream == null) return patchStream.Position;