Skip to content

Convention over errors #133

@NickGhignatti

Description

@NickGhignatti

Currently, our error handling is inconsistent across the codebase. We rely on a mix of:

  • Throwing generic exceptions.
  • Returning null or undefined.
  • Returning boolean flags.

This makes it difficult for developers to know exactly what can go wrong without diving into the implementation details, often leading to unhandled edge cases and "catch-all" blocks that obscure the root cause of issues.

I propose we implement a standardized Error , something like:

type Error= 
  | { type: 'NotFound'; message: string }
  | { type: 'ValidationError'; fields: string[] }
  | { type: 'Unauthorized'; action: string };

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions