From 2643dab58dd30c8382bbfd4ae2dd045dc8a8d9fc Mon Sep 17 00:00:00 2001 From: Paul <108695806+pxrl@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:53:22 +0100 Subject: [PATCH] fix: Clarify misleading error message (#891) This often fails due to RPC provider issues and incorrectly reports that the route is disabled. --- api/limits.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/limits.ts b/api/limits.ts index a040435ba..c766de888 100644 --- a/api/limits.ts +++ b/api/limits.ts @@ -109,10 +109,13 @@ const handler = async ( ]); // If any of the above fails or the route is not enabled, we assume that the if ( - disabledL1Tokens.includes(l1Token.toLowerCase()) || tokenDetailsResult.status === "rejected" || - routeEnabledResult.status === "rejected" || - !routeEnabledResult.value + routeEnabledResult.status === "rejected" + ) { + throw new InputError(`Unable to query route.`); + } else if ( + !routeEnabledResult.value || + disabledL1Tokens.includes(l1Token.toLowerCase()) ) { throw new InputError(`Route is not enabled.`); }