~/tags/api-design
#API Design
4 pages tagged across the site.
>> Blog
>> Opinions
Give callers two error types, one extending the other
A single catch-all exception forces every call site to over-handle. Two types in a hierarchy let each caller pick its own granularity.
Generic returns can be the right call for a library you maintain aloneTyped response structs are the default advice. For a one-person library wrapping a churny upstream API, `(any, error)` was the cheaper long-term choice.