Merge pull request #2108 from jcanizales/disallow-started-writers

Disallow started request writers on GRPCCall init
pull/2116/head
Michael Lumish 10 years ago
commit 22a7cdffc4
  1. 4
      src/objective-c/GRPCClient/GRPCCall.m

@ -100,7 +100,9 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
if (!host || !method) { if (!host || !method) {
[NSException raise:NSInvalidArgumentException format:@"Neither host nor method can be nil."]; [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])) { if ((self = [super init])) {
static dispatch_once_t initialization; static dispatch_once_t initialization;
dispatch_once(&initialization, ^{ dispatch_once(&initialization, ^{

Loading…
Cancel
Save