Skip to content

Commit 74ee934

Browse files
fix: wc reports unsupported method correctly
1 parent e13d2f4 commit 74ee934

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/core/src/beaconUtils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type PartialTezosOperation, TezosOperationType } from "@airgap/beacon-wallet";
22
import { isValidImplicitPkh, parseImplicitPkh, parsePkh } from "@umami/tezos";
3-
import { CustomError } from "@umami/utils";
3+
import { WalletConnectError, WcErrorCode } from "@umami/utils";
44

55
import { type ImplicitAccount } from "./Account";
66
import { type ImplicitOperations } from "./AccountOperations";
@@ -19,7 +19,7 @@ export const toAccountOperations = (
1919
signer: ImplicitAccount
2020
): ImplicitOperations => {
2121
if (operationDetails.length === 0) {
22-
throw new CustomError("Empty operation details!");
22+
throw new WalletConnectError("Empty operation details!", WcErrorCode.INVALID_PARAMS, null);
2323
}
2424

2525
const operations = operationDetails.map(operation =>
@@ -106,6 +106,10 @@ export const partialOperationToOperation = (
106106
};
107107
}
108108
default:
109-
throw new CustomError(`Unsupported operation kind: ${partialOperation.kind}`);
109+
throw new WalletConnectError(
110+
`Unsupported operation kind: ${partialOperation.kind}`,
111+
WcErrorCode.METHOD_UNSUPPORTED,
112+
null
113+
);
110114
}
111115
};

0 commit comments

Comments
 (0)