From a3dc47b5eb895e7d715dc9bd72cb825a599c6d2f Mon Sep 17 00:00:00 2001 From: delivan Date: Thu, 15 Dec 2022 01:07:58 +0900 Subject: [PATCH] Modify to throw error on request promise --- pages/verification/index.tsx | 3 +-- utils/url.ts | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pages/verification/index.tsx b/pages/verification/index.tsx index 80edc15..be71e02 100644 --- a/pages/verification/index.tsx +++ b/pages/verification/index.tsx @@ -32,7 +32,6 @@ import { simulateMsgs, } from "../../wallets"; import { ChainIdHelper } from "@keplr-wallet/cosmos"; -import ErrorBoundary from "../../components/error-boundary"; import AllChainsIcon from "../../public/images/svg/all-chains-icon.svg"; import { AllChainsItem } from "../../components/chain-list/all-chains-item"; @@ -118,7 +117,7 @@ export default function VerificationPage() { ); } } catch (e) { - console.log(e); + console.error(e); } finally { setIsLoading(false); } diff --git a/utils/url.ts b/utils/url.ts index 8f1b51f..b76ac95 100644 --- a/utils/url.ts +++ b/utils/url.ts @@ -5,10 +5,8 @@ export function request( return fetch(url, config) .then((response) => { if (!response.ok) { - console.error( - new Error( - `This is an HTTP error: The status is ${response.status} ${response.statusText}`, - ), + throw new Error( + `This is an HTTP error: The status is ${response.status} ${response.statusText}`, ); } return response.json();