CofheError objects on failure. This replaces the Result wrapper pattern used by cofhejs.
Catching errors
CofheError structure
EveryCofheError has:
code— aCofheErrorCodeenum value identifying the error typemessage— a human-readable description of what went wrong
isCofheError(err) to check if a caught error is a CofheError.
Common error codes
| Error code | When it occurs |
|---|---|
ZkPackFailed | encryptInputs exceeded the 2048-bit plaintext limit |
PermitNotFound | No permit found for the given chainId + account |
PermitInvalid | The permit signature is invalid or expired |
DecryptFailed | Decryption request was rejected by the Threshold Network |
NotConnected | Attempted an operation before calling client.connect(...) |