Browse Popular

If a function can fail, return a discriminated union (`{ ok: true; data: T } | { ok: false; error: E }`) instead of throwing — callers are forced to handle both cases.

typescript
Style Guide
TypeScript Defaults
#bcfdd18dfc3b5e40First seen Mar 2, 2026

0

Up

1

Down

-1

Net

Voting History

Loading...

AI Assessment

No AI assessment yet for this rule.

Similar Rules