aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c
diff options
context:
space:
mode:
authorGravatar Michael Lumish <mlumish@google.com>2015-06-17 16:38:19 -0700
committerGravatar Michael Lumish <mlumish@google.com>2015-06-17 16:38:19 -0700
commit22a7cdffc444fbda6c8967ee75c49487e0501600 (patch)
tree324545ecdcbddec66ef2f3d424f330212cd8dd15 /src/objective-c
parentf1a495573f728034c4a0080a9c8c188fec3d6c46 (diff)
parent6bbfcc3fec703438690f308f3a706f58c87380e1 (diff)
Merge pull request #2108 from jcanizales/disallow-started-writers
Disallow started request writers on GRPCCall init
Diffstat (limited to 'src/objective-c')
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index d92a9d1b37..a9625a1799 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -100,7 +100,9 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
if (!host || !method) {
[NSException raise:NSInvalidArgumentException format:@"Neither host nor method can be nil."];
}
- // TODO(jcanizales): Throw if the requestWriter was already started.
+ if (requestWriter.state != GRXWriterStateNotStarted) {
+ [NSException raise:NSInvalidArgumentException format:@"The requests writer can't be already started."];
+ }
if ((self = [super init])) {
static dispatch_once_t initialization;
dispatch_once(&initialization, ^{