From cb27da48b716d7678f3da493a45b11b6ebdda747 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Tue, 15 Mar 2022 16:51:10 +1100 Subject: [PATCH] Updated the code to handle a clock out of sync error (different error code from v2 & v3) --- SessionSnodeKit/OnionRequestAPI.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SessionSnodeKit/OnionRequestAPI.swift b/SessionSnodeKit/OnionRequestAPI.swift index 6c7a4dd52..acceac62d 100644 --- a/SessionSnodeKit/OnionRequestAPI.swift +++ b/SessionSnodeKit/OnionRequestAPI.swift @@ -615,8 +615,8 @@ public enum OnionRequestAPI: OnionRequestAPIType { return seal.reject(HTTP.Error.invalidResponse) } - // Custom handle a clock out of sync error - guard responseInfo.code != 406 else { + // Custom handle a clock out of sync error (v4 returns '425' but included the '406' just in case) + guard responseInfo.code != 406 && responseInfo.code != 425 else { SNLog("The user's clock is out of sync with the service node network.") return seal.reject(SnodeAPI.Error.clockOutOfSync) }