rust-errors

Installation
SKILL.md

Rust to TypeScript Error Handling

Reference Repositories

  • Tauri — Desktop app framework (source of Rust-to-TypeScript error patterns)

When to Apply This Skill

Use this pattern when you need to:

  • Send Rust errors through Tauri commands to TypeScript clients.
  • Define Rust enums that serialize into discriminated union error shapes.
  • Validate unknown error payloads in TypeScript before switching on variants.
  • Keep cross-language error payloads consistent with name and message fields.
  • Avoid serde tagging patterns that produce nested, awkward TypeScript shapes.

Discriminated Union Pattern for Errors

When passing errors from Rust to TypeScript through Tauri commands, use internally-tagged enums to create discriminated unions that TypeScript can handle naturally.

Related skills

More from epicenterhq/epicenter

Installs
80
GitHub Stars
4.5K
First Seen
Jan 20, 2026