aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2018-09-07 13:13:27 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2018-09-07 13:13:27 -0700
commit917af9a47f6141b897e1288a71e846f054941a39 (patch)
tree25b27cf27436f08f175d5964fd84717c720d0ab5 /src/csharp
parent603a9a06353f5e53092e6d0bd2db2ec995ae1731 (diff)
use finally instead of catch-throw
Diffstat (limited to 'src/csharp')
-rw-r--r--src/csharp/Grpc.Core/Internal/AsyncCall.cs15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs
index 0953f59a18..4cdf0ee6a7 100644
--- a/src/csharp/Grpc.Core/Internal/AsyncCall.cs
+++ b/src/csharp/Grpc.Core/Internal/AsyncCall.cs
@@ -125,7 +125,7 @@ namespace Grpc.Core.Internal
}
}
}
- catch (Exception)
+ finally
{
if (!callStartedOk)
{
@@ -134,7 +134,6 @@ namespace Grpc.Core.Internal
OnFailedToStartCallLocked();
}
}
- throw;
}
// Once the blocking call returns, the result should be available synchronously.
@@ -172,13 +171,12 @@ namespace Grpc.Core.Internal
return unaryResponseTcs.Task;
}
- catch (Exception)
+ finally
{
if (!callStartedOk)
{
OnFailedToStartCallLocked();
}
- throw;
}
}
}
@@ -210,13 +208,12 @@ namespace Grpc.Core.Internal
return unaryResponseTcs.Task;
}
- catch (Exception)
+ finally
{
if (!callStartedOk)
{
OnFailedToStartCallLocked();
}
- throw;
}
}
}
@@ -248,13 +245,12 @@ namespace Grpc.Core.Internal
}
call.StartReceiveInitialMetadata(ReceivedResponseHeadersCallback);
}
- catch (Exception)
+ finally
{
if (!callStartedOk)
{
OnFailedToStartCallLocked();
}
- throw;
}
}
}
@@ -283,13 +279,12 @@ namespace Grpc.Core.Internal
}
call.StartReceiveInitialMetadata(ReceivedResponseHeadersCallback);
}
- catch (Exception)
+ finally
{
if (!callStartedOk)
{
OnFailedToStartCallLocked();
}
- throw;
}
}
}