Commit 22a9fac
doc: restructure README to explain the return-over-throw paradigm
- Add "The Problem with try/catch" section explaining why catch(e)
yields unknown and throw cannot express errors in type signatures
- Add "The Idea: Return Errors, Don't Throw Them" section introducing
the return-value approach with a findUser example
- Replace mathematical examples with a login example (USER_NOT_FOUND,
ACCOUNT_LOCKED, WRONG_PASSWORD) to make typed cause more relatable
- Use early return pattern instead of if/else in caller examples
- Convert API property list to a table with Enumerable column
- Move Features section below the problem/solution narrative
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c1972ba commit 22a9fac
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 64 | + | |
67 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 130 | + | |
132 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| |||
0 commit comments