leptos-error-handling

Community

Robust error handling for Leptos server apps.

Authoradelabdelgawad
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Leptos apps that mix server functions, Axum endpoints, and view components often leak internal errors or present inconsistent user-facing messages. This Skill provides a structured approach to defining AppError, mapping sqlx errors, and wiring IntoResponse and ErrorBoundary to deliver safe, consistent error handling across server and client boundaries.

Core Features & Use Cases

  • AppError pattern: Domain error enum must be Clone + Serialize + Deserialize; implement FromServerFnError for server fn error framing.
  • SQLx error mapping: Map RowNotFound to NotFound; map database errors to Internal with logs for debugging.
  • IntoResponse integration: Implement IntoResponse for AppError to produce appropriate HTTP status codes and error bodies.
  • ErrorBoundary usage: Wrap UI closures with ErrorBoundary to catch Domain errors during rendering.
  • Validation pattern: Use AppError::Validation for input validation errors to return 422s with helpful messages.

Quick Start

Define AppError, implement FromServerFnError, map SQLx errors, and wire IntoResponse and ErrorBoundary in your Leptos/Axum app.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: leptos-error-handling
Download link: https://github.com/adelabdelgawad/rust-fullstack-agents/archive/main.zip#leptos-error-handling

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.