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.
1
Up
1
Down
0
Net
The agent cannot infer the non-standard convention of using specific discriminated unions instead of throwing exceptions, which contradicts common TypeScript/JavaScript defaults.
Agent can't figure this out alone