Skip to content

Commit 1aea42f

Browse files
Logs parse errors
1 parent 288a5b5 commit 1aea42f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

AppBox/Common/NetworkHandler/NetworkHandler.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ +(void)requestWithURL:(NSString *)url withParameters:(id)parmeters andRequestTyp
2626
// Parse the body as JSON (mirrors AFJSONResponseSerializer).
2727
id responseObject = nil;
2828
if (data.length > 0) {
29-
responseObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
29+
NSError *jsonError = nil;
30+
responseObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
31+
if (jsonError) {
32+
DDLogDebug(@"JSON parsing failed for URL: %@", jsonError.localizedDescription);
33+
}
3034
}
3135

3236
BOOL httpSuccess = (statusCode >= 200 && statusCode < 300);

0 commit comments

Comments
 (0)