Skip to content

Add missing error codes to docs/error-codes.md #403

Description

@Levi-Ojukwu

Description:

The docs/error-codes.md file serves as the definitive reference for all numeric error codes returned by the ILN contracts. However, several error codes introduced in recent features are missing from this documentation.

Specifically, the following error codes are defined in contracts/invoice_liquidity/src/errors.rs but not documented:

  • InvoiceNftAlreadyExists (value 37) — returned when attempting to mint an NFT for an invoice that already has one
  • InvoiceNftNotFound (value 38) — returned when querying or transferring a non-existent NFT
  • InvoiceNftNotOwned (value 39) — returned when a non-owner attempts to transfer or burn an NFT
  • AmountTooSmall (value 36) — returned when an invoice amount is below the configurable minimum threshold

Additionally, the InsuranceError enum from contracts/insurance_pool/src/lib.rs is entirely undocumented:

  • NotInitialized (1) — contract has not been initialised with an admin
  • AlreadyClaimed (2) — a claim has already been processed for this invoice
  • InvalidAmount (3) — premium/coverage amount must be positive
  • PoolEmpty (4) — pool has no balance available to pay a claim
  • AlreadyInitialized (5) — contract is already initialised

The GovernanceError enum from contracts/iln_governance/src/lib.rs also has undocumented codes:

  • InvalidQuorumBps (15) — invalid quorum basis points
  • NotAdmin (16) — caller is not the admin
  • NotVetoable (17) — proposal cannot be vetoed in its current status
  • VetoPowerDisabled (18) — admin veto power has been disabled
  • InsufficientProposerBalance (19) — proposer does not hold minimum required token balance

Why it matters: Contributors debugging contract interactions rely on this file to understand error responses. Missing error codes force developers to read raw source code, slowing down integration work.

Acceptance Criteria:

  • Add all missing error codes from invoice_liquidity/src/errors.rs with their numeric values, enum variant names, descriptions, and remediation steps
  • Add all InsuranceError codes from insurance_pool/src/lib.rs:33-46
  • Add all GovernanceError codes from iln_governance/src/lib.rs:34-63
  • Follow the existing format: | Code | Name | Description | Remediation |
  • Group error codes by contract/crate for clarity

Relevant Files: docs/error-codes.md, contracts/invoice_liquidity/src/errors.rs:1-58, contracts/insurance_pool/src/lib.rs:33-46, contracts/iln_governance/src/lib.rs:34-63


Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions