Accept non-string type in getAccount error
This commit is contained in:
@@ -154,8 +154,8 @@ export class CosmWasmClient {
|
||||
try {
|
||||
const account = await this.forceGetQueryClient().auth.account(searchAddress);
|
||||
return account ? accountFromAny(account) : null;
|
||||
} catch (error) {
|
||||
if (typeof error === "string" && /rpc error: code = NotFound/i.test(error)) {
|
||||
} catch (error: any) {
|
||||
if (/rpc error: code = NotFound/i.test(error.toString())) {
|
||||
return null;
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -214,8 +214,8 @@ export class StargateClient {
|
||||
try {
|
||||
const account = await this.forceGetQueryClient().auth.account(searchAddress);
|
||||
return account ? accountFromAny(account) : null;
|
||||
} catch (error) {
|
||||
if (typeof error === "string" && /rpc error: code = NotFound/i.test(error)) {
|
||||
} catch (error: any) {
|
||||
if (/rpc error: code = NotFound/i.test(error.toString())) {
|
||||
return null;
|
||||
}
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user