Skip to main content

Module diagnostic

Module diagnostic 

Source
Expand description

Stable, machine-readable diagnostic codes.

Codes attach to JsonMessage entries inside JsonEnvelope errors[] and warnings[].

See docs/agents/diagnostics.md for the format and registry rules. Codes are namespaced strings of the form ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$.

§Implementation choice

Codes are exposed as &'static str constants, organised in per-domain modules colocated with this crate (or, for adoption PRs, with the owning crate). JsonMessage::error accepts impl Into<String>, so call sites pass the constant directly. The DiagnosticCode newtype is available when callers want a parsed, validated value.

Modules§

anvil
anvil diagnostic codes.
cast
cast diagnostic codes.
chisel
chisel diagnostic codes.
cli
CLI-layer diagnostic codes (argument parsing, global flags).
compiler
Compiler diagnostic codes (foundry-compilers, forge).
config
foundry-config diagnostic codes.
network
Network / RPC diagnostic codes.
script
forge script diagnostic codes.
test
forge test diagnostic codes.
wallet
foundry-wallets diagnostic codes.

Structs§

DiagnosticCode
Stable, machine-readable diagnostic code attached to a structured message.
InvalidDiagnosticCode
Validation error returned by DiagnosticCode::new / validate.

Functions§

known_codes
All diagnostic codes declared in this crate.
validate
Validate that s matches the diagnostic-code grammar.