Skip to content

Commit 7aa7ad3

Browse files
committed
[nits] improve string description of OneSignalClientError
Motivation: - previously it would log like this: "request failed with error: <OneSignalClientError: 0x600000cd49c0> - now it will log like this: "request failed with error: <OneSignalClientError code: 202, message: Error parsing JSON, response: (null), underlyingError: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0., NSJSONSerializationErrorIndex=0} >"
1 parent 1a76916 commit 7aa7ad3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OneSignalClientError.m

+4
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ - (instancetype)initWithCode:(NSInteger)code message:(NSString* _Nonnull)message
4646
return self;
4747
}
4848

49+
- (NSString *)description {
50+
return [NSString stringWithFormat:@"<OneSignalClientError code: %ld, message: %@, response: %@, underlyingError: %@ >", (long)_code, _message, _response, _underlyingError];
51+
}
52+
4953
@end

0 commit comments

Comments
 (0)