AXIOM Axiom Documentation
UABLACKGRAYWHITE
Axiom · dark

Errors without exceptions

Errors are ordinary typed variants, so failure paths remain visible in control flow and resource analysis.

Typed error categories

Typed errorsAxiom
1request_error:2    | bad_method3    | bad_path4    | payload_too_large(usize actual, usize limit)5    | io(io_error)6END request_error
1

A nominal error type.

2

Simple variant.

4

Errors may carry useful diagnostic data.

5

Another error ADT can be nested safely.

Handle at a boundary

HTTP-like boundaryAxiom
1handle(request req) -> response:2    match parse(req):3        ok(command):4            RETURN execute(command)5        error(payload_too_large(actual, limit)):6            RETURN response.bad_request(text.format("{} > {}", actual, limit))7        error(_):8            RETURN response.bad_request("invalid request")
2

Parsing returns a result.

3

Success path.

5

Specific error mapping.

8

The remaining parse failures become HTTP 400.

Fatal invariant violations may still have a dedicated system path, but ordinary I/O, timeout, parse, or permission conditions are data, not hidden exception edges.