Reference · 06
Error Diagnostics
Guide to reading Ochre's ariadne compiler and runtime diagnostics, common error messages, and how to resolve them quickly.
Ochre renders syntax, type, and runtime errors using ariadne with source spans, inline labels, and actionable help: hints.
Common Compile-Time Diagnostics
Immutability Violation
error: cannot mutate immutable variable `rows`
help: declare `rows` with `var` to allow mutation
Cause: Assigning to a let variable or mutating any nested index/field reachable through a let binding. Fix: Change let rows = ... to var rows = ....
Built-in Generic Mismatch
error: cannot push `Str` into `List<Int>`
Cause: Passing an element incompatible with a list's element type, a non-Bool predicate to filter, or a wrong payload type to send(ch, val). Fix: Match the collection/channel element type or convert explicitly (int(), str()).
Non-Exhaustive match
error: non-exhaustive `match` on enum `Color`: missing Blue
help: handle all variants or add a `_ => ...` wildcard arm
Cause: One or more enum, Option, or Result variants are missing from a match expression without a _ wildcard. Fix: Add arms for every missing variant or add _ => ....
Conflicting or Partial spawn Returns
error: conflicting return types in `spawn` block: expected `Int`, found `Void`
Cause: A spawn block returns a value on one branch while another path falls through without returning, or returns two incompatible types. Fix: Ensure every execution path in the spawn block returns the same type.
? Propagation Mismatch
error: `?` cannot propagate error `Str` in this function
help: ensure the function returns a compatible `T!E` Result type
Cause: Using ? inside a function whose return type is not a compatible Option or Result. Fix: Return T!E from the enclosing function, or use ?? to supply a fallback value.
HTTP Handler Validation
error: `http_serve` callback expects 1 parameter(s), found 0
Cause: Passing a handler function or closure that does not accept the request map argument, or returns a non-Map value. Fix: Use (req) => #{ "status": "200", "body": "..." } or fn handle(req: Map<Str, Str>) -> Map<Str, Str>.