Commit 83fe4d6 1 parent 8ee0305 commit 83fe4d6 Copy full SHA for 83fe4d6
File tree 2 files changed +4
-12
lines changed
src/EFCore.Relational/Update
2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ protected override void Consume(RelationalDataReader reader)
84
84
"Expected " + expectedResultSetCount + " result sets, got " + actualResultSetCount ) ;
85
85
#endif
86
86
}
87
- catch ( Exception ex ) when ( ! ( ex is DbUpdateException ) )
87
+ catch ( Exception ex ) when ( ex is not DbUpdateException and not OperationCanceledException )
88
88
{
89
89
throw new DbUpdateException (
90
90
RelationalStrings . UpdateStoreException ,
@@ -150,7 +150,7 @@ protected override async Task ConsumeAsync(
150
150
"Expected " + expectedResultSetCount + " result sets, got " + actualResultSetCount ) ;
151
151
#endif
152
152
}
153
- catch ( Exception ex ) when ( ! ( ex is DbUpdateException ) )
153
+ catch ( Exception ex ) when ( ex is not DbUpdateException and not OperationCanceledException )
154
154
{
155
155
throw new DbUpdateException (
156
156
RelationalStrings . UpdateStoreException ,
Original file line number Diff line number Diff line change @@ -252,11 +252,7 @@ public override void Execute(IRelationalConnection connection)
252
252
Dependencies . Logger , CommandSource . SaveChanges ) ) ;
253
253
Consume ( dataReader ) ;
254
254
}
255
- catch ( DbUpdateException )
256
- {
257
- throw ;
258
- }
259
- catch ( Exception ex )
255
+ catch ( Exception ex ) when ( ex is not DbUpdateException and not OperationCanceledException )
260
256
{
261
257
throw new DbUpdateException (
262
258
RelationalStrings . UpdateStoreException ,
@@ -293,11 +289,7 @@ public override async Task ExecuteAsync(
293
289
cancellationToken ) . ConfigureAwait ( false ) ;
294
290
await ConsumeAsync ( dataReader , cancellationToken ) . ConfigureAwait ( false ) ;
295
291
}
296
- catch ( DbUpdateException )
297
- {
298
- throw ;
299
- }
300
- catch ( Exception ex )
292
+ catch ( Exception ex ) when ( ex is not DbUpdateException and not OperationCanceledException )
301
293
{
302
294
throw new DbUpdateException (
303
295
RelationalStrings . UpdateStoreException ,
You can’t perform that action at this time.
0 commit comments