I built a thin wrapper over the Fetch API that returns errors as values instead of throwing. Inspired by Go's result, err pattern.
No try/catch. TypeScript narrows the error type so you know exactly which HTTP errors to handle at compile time. 40 typed error classes for all standard status codes, plus a separate NetworkError for connection failures.
I built a thin wrapper over the Fetch API that returns errors as values instead of throwing. Inspired by Go's result, err pattern.
No try/catch. TypeScript narrows the error type so you know exactly which HTTP errors to handle at compile time. 40 typed error classes for all standard status codes, plus a separate NetworkError for connection failures.
Would love feedback on the API design.