Skip to content

Commit 25bdb17

Browse files
committed
fix up failing test
1 parent e073e6d commit 25bdb17

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Microsoft.Azure.Cosmos/src/Query/Core/ExceptionToCosmosException.cs

+12-8
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,18 @@ private static bool TryCreateFromExceptionWithStackTrace(
8686
return false;
8787
}
8888

89-
cosmosException = CosmosExceptionFactory.Create(
90-
cosmosException.StatusCode,
91-
cosmosException.Message,
92-
exceptionWithStackTrace.StackTrace,
93-
headers: cosmosException.Headers,
94-
cosmosException.Trace,
95-
cosmosException.Error,
96-
cosmosException.InnerException);
89+
if (innerException is not CosmosException && innerException is not Documents.DocumentClientException)
90+
{
91+
cosmosException = CosmosExceptionFactory.Create(
92+
cosmosException.StatusCode,
93+
cosmosException.Message,
94+
exceptionWithStackTrace.StackTrace,
95+
headers: cosmosException.Headers,
96+
cosmosException.Trace,
97+
cosmosException.Error,
98+
cosmosException.InnerException);
99+
}
100+
97101
return true;
98102
}
99103

0 commit comments

Comments
 (0)