File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,16 @@ base-lite "fix this bug" # Works right away!
8888- Always clean build state when encountering persistent type errors or infinite loops
8989- The monorepo structure with project references can sometimes create dependency cycles
9090
91+ ## Error Handling Philosophy
92+
93+ ** Prefer ` ErrorOr<T> ` return types over throwing errors.**
94+
95+ - Return type ` ErrorOr<T> ` for operations that fail
96+ - Return ` success(value) ` or ` failure(error) ` from ` common/src/util/error.ts `
97+ - e.g. ` return failure(new Error('File not found')) `
98+ - Allows callers to handle errors explicitly without try-catch
99+ - Makes error cases visible in function signatures
100+
91101## Error Handling and Debugging
92102
93103- Error messages are logged to console and debug log files
You can’t perform that action at this time.
0 commit comments