Skip to main content

Errors

Always wrap provider requests in try / catch. Pali uses standard JSON-RPC and EIP-1193 style errors where possible, plus wallet-specific errors for unsupported networks, hardware wallet restrictions, and passkey states.

try {
await window.ethereum.request({
method: 'eth_sendTransaction',
params: [tx],
});
} catch (error) {
switch (error.code) {
case 4001:
console.log('User rejected the request.');
break;
case 4100:
console.log('The dapp is not authorized.');
break;
case 4200:
console.log('The method is unsupported.');
break;
default:
console.error(error);
}
}

Common categories

CodeMeaning
4001User rejected the request.
4100Unauthorized account or method.
4101Method is only available for a different chain family.
4200Unsupported method.
4900Provider disconnected.
4901Provider disconnected from the requested chain.
5710The EIP-5792 bundle's chain has no RPC configured in the wallet (wallet_getCallsStatus / wallet_showCallsStatus).
5720Duplicate dapp-provided EIP-5792 bundle id in wallet_sendCalls.
5730Unknown EIP-5792 bundle id in wallet_getCallsStatus / wallet_showCallsStatus.

See Error codes for the longer reference.