Skip to main content

Module error

Module error 

Source
Expand description

Application-level error type.

AppError is the typed error used across all use cases and handlers, replacing the legacy Result<_, String> pattern (cf. issues #425, #427).

Migration started in story AUTH-001 (auth_use_cases.rs).

§Design

  • thiserror for ergonomic error definitions.
  • actix_web::ResponseError impl maps each variant to the right HTTP status.
  • From<String> is intentionally provided as a transition convenience for repositories still returning Result<_, String>. Variants should be used directly when a specific error semantic applies.

§Anti-patterns explicitly avoided

  • Leaking sensitive data in error messages exposed to clients (DB connection strings, internal IPs, stack traces). The error_response() body returns a structured payload; redaction policy will be enforced in a follow-up RFC (see #429 §6 and astro-svelte-expert.memory.md).
  • Returning generic Internal for everything (defeats the purpose of typed errors and HTTP status discrimination).

Enums§

AppError
Application-level error.