From fc99ff6644e51297c4d20b686a62783161c8500b Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 6 Jul 2016 15:08:30 -0700 Subject: Fix error code when client run out of memory in Objective C code base Update Status Codes documentation --- src/objective-c/GRPCClient/GRPCCall.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/objective-c') diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index e9678f38a9..71121094af 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -213,8 +213,8 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; // (because it's just a client problem). Use another domain and an // appropriately-documented code. [weakSelf finishWithError:[NSError errorWithDomain:kGRPCErrorDomain - code:GRPCErrorCodeInternal - userInfo:nil]]; + code:GRPCErrorCodeResourceExhausted + userInfo:@{NSLocalizedDescriptionKey: @"Client out of memory."}]]; [weakSelf cancelCall]; return; } -- cgit v1.2.3 From ff6cd70a1b4f8e711d45ed1c127192f92a1bc805 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 7 Jul 2016 09:57:54 -0700 Subject: Update error message when client does not enough memory to hold server response --- src/objective-c/GRPCClient/GRPCCall.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/objective-c') diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 71121094af..a5c6751c89 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -214,7 +214,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; // appropriately-documented code. [weakSelf finishWithError:[NSError errorWithDomain:kGRPCErrorDomain code:GRPCErrorCodeResourceExhausted - userInfo:@{NSLocalizedDescriptionKey: @"Client out of memory."}]]; + userInfo:@{NSLocalizedDescriptionKey: @"Client does not have enough memory to hold the server response."}]]; [weakSelf cancelCall]; return; } -- cgit v1.2.3 From 3b67f3622bb51bd7a2f6eacd81cd93d8578d52ef Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 14 Jul 2016 14:36:41 -0700 Subject: Remove redundant comment --- src/objective-c/GRPCClient/GRPCCall.m | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/objective-c') diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index a5c6751c89..7b2b6d4e9d 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -208,10 +208,6 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; // don't want to throw, because the app shouldn't crash for a behavior // that's on the hands of any server to have. Instead we finish and ask // the server to cancel. - // - // TODO(jcanizales): No canonical code is appropriate for this situation - // (because it's just a client problem). Use another domain and an - // appropriately-documented code. [weakSelf finishWithError:[NSError errorWithDomain:kGRPCErrorDomain code:GRPCErrorCodeResourceExhausted userInfo:@{NSLocalizedDescriptionKey: @"Client does not have enough memory to hold the server response."}]]; -- cgit v1.2.3