Modeling errors in Now CLI
summary
Argues for modeling errors end-to-end in Now CLI by turning API error payloads into typed local errors, wrapping fetch to throw an API error object, and converting that into richer CLI-specific constructors so createAlias can pattern-match on a missing-domain case and suggest exact remediation. Demonstrates using subclasses of Error, a HOF wrapper, and Flow-style union return types to force handling across ~100 microservices and across async boundaries so unexpected 500s become actionable, specific responses.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:13undefined is not a function
- 2:07unknown error space
- 4:26what's the entry?
- 13:59throw vs return
- 14:51what are the errors a function can throw?
related talks
27mModeling errors in Now CLI
57mError handling: doing it right!
27mUsing Monads for Elegant Error Handling
19mNode.js Error Handling
32mWriting Better Errors
32mError handling: doing it right!
20mGetting into the Flow: Towards Better Type Error Messages for Constraint-Based ...
46mSystematically handling errors in your code to make them useful
