forked from LaconicNetwork/icns-frontend
Modify to throw error on request promise
This commit is contained in:
parent
d14eead3ba
commit
a3dc47b5eb
@ -32,7 +32,6 @@ import {
|
|||||||
simulateMsgs,
|
simulateMsgs,
|
||||||
} from "../../wallets";
|
} from "../../wallets";
|
||||||
import { ChainIdHelper } from "@keplr-wallet/cosmos";
|
import { ChainIdHelper } from "@keplr-wallet/cosmos";
|
||||||
import ErrorBoundary from "../../components/error-boundary";
|
|
||||||
|
|
||||||
import AllChainsIcon from "../../public/images/svg/all-chains-icon.svg";
|
import AllChainsIcon from "../../public/images/svg/all-chains-icon.svg";
|
||||||
import { AllChainsItem } from "../../components/chain-list/all-chains-item";
|
import { AllChainsItem } from "../../components/chain-list/all-chains-item";
|
||||||
@ -118,7 +117,7 @@ export default function VerificationPage() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.error(e);
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,8 @@ export function request<TResponse>(
|
|||||||
return fetch(url, config)
|
return fetch(url, config)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
console.error(
|
throw new Error(
|
||||||
new Error(
|
|
||||||
`This is an HTTP error: The status is ${response.status} ${response.statusText}`,
|
`This is an HTTP error: The status is ${response.status} ${response.statusText}`,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return response.json();
|
return response.json();
|
||||||
|
Loading…
Reference in New Issue
Block a user