Skip to content

Design proposal: complete std/errors API for Neva dataflow #1046

@emil14

Description

@emil14

Summary

Design and standardize std/errors API for practical dataflow usage in Neva.

Why

Current std/errors has minimal surface (New, Must, Lift) and does not define a complete, idiomatic toolkit for wrapping, context enrichment, matching, chain traversal, and conversion/interoperability scenarios.

Scope

  • Define required use-cases first.
  • Audit which use-cases are already covered and where gaps exist.
  • Propose concrete API shape and naming.

Inputs to review

  • Go stdlib patterns (errors.Is, errors.As, errors.Join, %w semantics)
  • Rust ecosystem ideas (not Result migration; only error-tooling ergonomics)
  • Existing Neva constraints: explicit dataflow, res/err outports, ? err-guard.

Non-goals

  • No migration to Rust-style Result<T,E> language contract.
  • No change to res/err outport model.

Candidate use-cases

  1. Create/wrap with context
  2. Check by kind/category/sentinel
  3. Unwrap / iterate chain
  4. Normalize external errors into Neva error
  5. Aggregate multiple errors where relevant
  6. Render error chain for logs/debug

Deliverables

  • Proposed API list for std/errors with component signatures and examples
  • Rationale/tradeoffs for each API item
  • Migration notes for existing code

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaThinking neededmediumDaysp1We can live without it but it's very important
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions