From 6a1d0e93a345fcf292be3d73b5a7ec4f4f0cff12 Mon Sep 17 00:00:00 2001 From: Ryan Tharp Date: Wed, 14 Apr 2021 19:41:54 -0700 Subject: [PATCH] Make 502 retry --- ts/session/snode_api/onions.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ts/session/snode_api/onions.ts b/ts/session/snode_api/onions.ts index b10c70f7c..0f0c46d10 100644 --- a/ts/session/snode_api/onions.ts +++ b/ts/session/snode_api/onions.ts @@ -238,6 +238,13 @@ const processOnionResponse = async ( // FIXME: 401/500 handling? + // detect SNode is deregisted? + if (response.status === 502) { + log.warn(`(${reqIdx}) [path] Got 502: snode not found`); + + return RequestError.BAD_PATH; + } + // detect SNode is not ready (not in swarm; not done syncing) if (response.status === 503) { log.warn(`(${reqIdx}) [path] Got 503: snode not ready`);