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
anvildiagnostic codes.- cast
castdiagnostic codes.- chisel
chiseldiagnostic codes.- cli
- CLI-layer diagnostic codes (argument parsing, global flags).
- compiler
- Compiler diagnostic codes (
foundry-compilers,forge). - config
foundry-configdiagnostic codes.- network
- Network / RPC diagnostic codes.
- script
forge scriptdiagnostic codes.- test
forge testdiagnostic codes.- wallet
foundry-walletsdiagnostic codes.
Structs§
- Diagnostic
Code - Stable, machine-readable diagnostic code attached to a structured message.
- Invalid
Diagnostic Code - Validation error returned by
DiagnosticCode::new/validate.
Functions§
- known_
codes - All diagnostic codes declared in this crate.
- validate
- Validate that
smatches the diagnostic-code grammar.