Skip to content

Commit a615ad4

Browse files
committed
Using when filter.
1 parent 775989c commit a615ad4

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

Provider/src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbConnectionInternal.cs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,10 @@ public void ReleasePreparedCommands()
359359
// avoid it. (It maybe the connection to the server was down
360360
// for unknown reasons.)
361361
}
362-
catch (IscException ex)
363-
{
364-
if (ex.ErrorCode != IscCodes.isc_net_read_err &&
365-
ex.ErrorCode != IscCodes.isc_net_write_err &&
366-
ex.ErrorCode != IscCodes.isc_network_error)
367-
{
368-
throw;
369-
}
370-
}
362+
catch (IscException ex) when (ex.ErrorCode == IscCodes.isc_network_error
363+
|| ex.ErrorCode == IscCodes.isc_net_read_err
364+
|| ex.ErrorCode == IscCodes.isc_net_write_err)
365+
{ }
371366
}
372367
}
373368

@@ -481,9 +476,9 @@ private void EnsureActiveTransaction()
481476
if (HasActiveTransaction)
482477
throw new InvalidOperationException("A transaction is currently active. Parallel transactions are not supported.");
483478
}
484-
#endregion
479+
#endregion
485480

486-
#region Cancelation
481+
#region Cancelation
487482
public void EnableCancel()
488483
{
489484
_db.CancelOperation(IscCodes.fb_cancel_enable);
@@ -500,14 +495,14 @@ public void CancelCommand()
500495
{
501496
_db.CancelOperation(IscCodes.fb_cancel_raise);
502497
}
503-
#endregion
498+
#endregion
504499

505-
#region Infrastructure
500+
#region Infrastructure
506501
public FbConnectionInternal SetOwningConnection(FbConnection owningConnection)
507502
{
508503
_owningConnection = owningConnection;
509504
return this;
510505
}
511-
#endregion
506+
#endregion
512507
}
513508
}

0 commit comments

Comments
 (0)