From 75d0ab3d5daf068458cb0d3d9799115a0d899ee7 Mon Sep 17 00:00:00 2001 From: Russell Hancox Date: Thu, 25 Jul 2024 10:09:22 -0400 Subject: [PATCH] sync: Handle missing error string for abnormal statuses --- Source/santasyncservice/SNTSyncStage.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/santasyncservice/SNTSyncStage.mm b/Source/santasyncservice/SNTSyncStage.mm index 0d897b7d1..4ea778023 100644 --- a/Source/santasyncservice/SNTSyncStage.mm +++ b/Source/santasyncservice/SNTSyncStage.mm @@ -202,7 +202,9 @@ - (NSData *)dataFromRequest:(NSURLRequest *)request errStr = [NSHTTPURLResponse localizedStringForStatusCode:response.statusCode]; } else { code = (long)requestError.code; + if (code == 0) code = response.StatusCode; errStr = requestError.localizedDescription; + if (!errStr) errStr = @"Unknown Error"; } LOGE(@"HTTP Response: %ld %@", code, errStr); if (error != NULL) {