Skip to main content

Overview

When working with Solidity smart contracts, you’ve probably encountered cryptic error messages like:
You only get a 4-byte error selector (0x118cdaa7 here) with no readable message. The @fhenixprotocol/cofhe-errors package maps a selector back to the error name, signature, and source contract.

What's inside

  • 53 custom errors from 13 contracts, as of package version 1.0.2
  • Complete error signatures with parameter types
  • Source contract information
  • CLI lookup tool
  • JavaScript/TypeScript API
Version 1.0.2 of the package was published in January 2026 and predates the current contracts. Its database does not include errors added since, such as NotOnAccessList, DecryptFunctionNotSupported, LengthMismatch, NotShared, UnexpectedSharer, and the ACPShareRegistry errors. It still lists OnlyAggregatorAllowed, which the TaskManager no longer raises. When the CLI reports Error not found for selector, look the selector up on the error reference, which is generated from the deployed contracts.

Quick start

No installation is required. Use npx to decode an error:
Output:

Installation (optional)

Only install if you need to import the error database programmatically in your code:

CLI usage

Decode an error selector

When you see “execution reverted: 0x…”, decode it:

Search errors by name

Find errors when you know part of the error name:
Output:

List all known errors

Browse the complete error database:

JSON output

Get JSON output for scripting and automation:
Output:

Programmatic API

JavaScript/TypeScript usage

TypeScript with types

Error monitoring example

Error coverage

Package version 1.0.2 includes errors from the following contracts. The counts reflect the contracts at the time of that release, not the contracts deployed today.

How error selectors work

Solidity custom errors use a 4-byte selector computed as:
Example:
Becomes:
  • Signature: OwnableUnauthorizedAccount(address)
  • Selector: keccak256("OwnableUnauthorizedAccount(address)") = 0x118cdaa7...
  • First 4 bytes: 0x118cdaa7

Next steps