RetryingExecutionStrategy: Look at the HResult from the actual exception. When trying to create our own pseudo exception for test purposes. We are unable to get an IErrorRecords object, so that we can set the error data and add it to the list of errors. May need to look at a CoCreateInstance method to do it properly or just leave it as is

pull/204/head
Christopher Jolly 2 years ago
parent 9cd87c05e0
commit 88b3cba005

@ -114,7 +114,7 @@ namespace Microsoft.EntityFrameworkCore
protected override bool ShouldRetryOn(Exception exception)
{
var exceptionFullName = exception.GetType().FullName;
if (exceptionFullName != "System.Data.OleDb.OleDbException" &&
exceptionFullName != "System.Data.Odbc.OdbcException")
return false;
@ -122,6 +122,10 @@ namespace Microsoft.EntityFrameworkCore
if (_additionalErrorNumbers != null)
{
dynamic sqlException = exception;
if (_additionalErrorNumbers.Contains(exception.HResult))
{
return true;
}
foreach (var err in sqlException.Errors)
{
if (_additionalErrorNumbers.Contains(err.NativeError))

Loading…
Cancel
Save