Add ledger error

This commit is contained in:
HeesungB 2022-12-21 01:38:26 +09:00
parent aec2bc7fd3
commit 58b67a8b7e
2 changed files with 24 additions and 0 deletions

View File

@ -23,3 +23,11 @@ export const VERIFICATION_THRESHOLD_MESSAGE =
export const INVALID_REFERRAL_ERROR = "Invalid referral:";
export const INVALID_REFERRAL_MESSAGE =
"Make sure that the referrer ICNS name has been registered.";
export const TOO_MANY_CHAINS_IN_LEDGER_ERROR = "Output buffer too small";
export const TOO_MANY_CHAINS_IN_LEDGER_MESSAGE =
"Maximum 20 chains can be linked at a time on Ledger hardware wallet. Unselect some chains and try again.";
export const EVM_CHAIN_IN_LEDGER_ERROR = "Ledger is unsupported for this chain";
export const EVM_CHAIN_IN_LEDGER_MESSAGE =
"Ledger is unsupported for this chain. Remove EVM-based Cosmos SDK chains and try again.";

View File

@ -54,11 +54,15 @@ import {
import {
ACCOUNT_NOT_EXIST_ERROR,
ACCOUNT_NOT_EXIST_MESSAGE,
EVM_CHAIN_IN_LEDGER_ERROR,
EVM_CHAIN_IN_LEDGER_MESSAGE,
INSUFFICIENT_GAS_ERROR,
INSUFFICIENT_GAS_MESSAGE,
INVALID_REFERRAL_ERROR,
INVALID_REFERRAL_MESSAGE,
KEPLR_NOT_FOUND_ERROR,
TOO_MANY_CHAINS_IN_LEDGER_ERROR,
TOO_MANY_CHAINS_IN_LEDGER_MESSAGE,
TWITTER_LOGIN_ERROR,
VERIFICATION_THRESHOLD_ERROR,
VERIFICATION_THRESHOLD_MESSAGE,
@ -491,6 +495,18 @@ export default function VerificationPage() {
console.log(error.message);
captureException(error);
if (error.message.includes(TOO_MANY_CHAINS_IN_LEDGER_ERROR)) {
setErrorMessage({ message: TOO_MANY_CHAINS_IN_LEDGER_MESSAGE });
setErrorModalOpen(true);
return;
}
if (error.message.includes(EVM_CHAIN_IN_LEDGER_ERROR)) {
setErrorMessage({ message: EVM_CHAIN_IN_LEDGER_MESSAGE });
setErrorModalOpen(true);
return;
}
setErrorMessage({ message: error.message });
setErrorModalOpen(true);
}