aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/NSError+GRPC.m
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-08-11 21:19:14 -0400
committerGravatar ncteisen <ncteisen@gmail.com>2018-08-11 21:19:14 -0400
commitc8503544233421764c0cd04870db3d03a95bd47b (patch)
tree15c4ff633797d310b59a16905c51b216f6fa37a7 /src/objective-c/GRPCClient/private/NSError+GRPC.m
parente2a87dac6975b3cbf6e434e1bb5112269043653e (diff)
parente495476b1e31023637259883aa735fcc716c6adc (diff)
Merge branch 'master' of https://github.com/grpc/grpc into channelz-subchannels
Diffstat (limited to 'src/objective-c/GRPCClient/private/NSError+GRPC.m')
-rw-r--r--src/objective-c/GRPCClient/private/NSError+GRPC.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/private/NSError+GRPC.m b/src/objective-c/GRPCClient/private/NSError+GRPC.m
index c2e65e4d8a..199b2ebb6c 100644
--- a/src/objective-c/GRPCClient/private/NSError+GRPC.m
+++ b/src/objective-c/GRPCClient/private/NSError+GRPC.m
@@ -23,13 +23,19 @@
NSString *const kGRPCErrorDomain = @"io.grpc";
@implementation NSError (GRPC)
-+ (instancetype)grpc_errorFromStatusCode:(grpc_status_code)statusCode details:(char *)details {
++ (instancetype)grpc_errorFromStatusCode:(grpc_status_code)statusCode
+ details:(char *)details
+ errorString:(const char *)errorString {
if (statusCode == GRPC_STATUS_OK) {
return nil;
}
NSString *message = [NSString stringWithCString:details encoding:NSUTF8StringEncoding];
+ NSString *debugMessage = [NSString stringWithCString:errorString encoding:NSUTF8StringEncoding];
return [NSError errorWithDomain:kGRPCErrorDomain
code:statusCode
- userInfo:@{NSLocalizedDescriptionKey : message}];
+ userInfo:@{
+ NSLocalizedDescriptionKey : message,
+ NSDebugDescriptionErrorKey : debugMessage
+ }];
}
@end