-
Notifications
You must be signed in to change notification settings - Fork 0
Convention over errors #133
Copy link
Copy link
Open
1 / 11 of 1 issue completedLabels
Description
Currently, our error handling is inconsistent across the codebase. We rely on a mix of:
- Throwing generic exceptions.
- Returning
nullorundefined. - 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 };Reactions are currently unavailable