From 51142189c768b0560e4ea64cff1339caa031c9a5 Mon Sep 17 00:00:00 2001 From: Nik Ho Date: Wed, 28 Feb 2024 23:41:50 +1300 Subject: [PATCH] handle axios error in registered off chain check --- packages/x-provider/src/signable-actions/registration.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/x-provider/src/signable-actions/registration.ts b/packages/x-provider/src/signable-actions/registration.ts index ed21df92e1..978f0f1760 100644 --- a/packages/x-provider/src/signable-actions/registration.ts +++ b/packages/x-provider/src/signable-actions/registration.ts @@ -6,7 +6,7 @@ import { UsersApi, } from '@imtbl/core-sdk'; import { signRaw } from '@imtbl/toolkit'; -import { AxiosError } from 'axios'; +import { isAxiosError } from 'axios'; import { Signers } from './types'; import { validateChain } from './helpers'; import { ProviderConfiguration } from '../config'; @@ -56,7 +56,7 @@ export async function isRegisteredOffchain(ethAddress: string, config: ProviderC return accounts?.length > 0; } catch (ex) { - if (ex instanceof AxiosError && ex.response?.status === 404) { + if (isAxiosError(ex) && ex.response?.status === 404) { return false; } throw ex;