#Error-Handling
6 notas · última:
The 80/20 Guide to Express Error Handling
Explains how Express error-handling middleware centralizes HTTP error responses, how `next()` routes async failures to handlers, and how `wrapAsync()` makes async/await errors work cleanly.
Elixir's Secret Weapon
Explains Elixir's with special form as the fix for nested case statements when chaining dependent operations that each return a tagged {:ok, _} / {:error, _} tuple.
Replacing Exceptions-as-flow-control with the Result Pattern
Andrew Lock walks a C# service through three stages — exceptions for flow control, a basic Result<T>, and a safer Switch()-based Result<T> — showing why each trade-off matters.
Using Express.js Routes for Promise-based Error Handling
The article compares three ways to handle promise-based responses and errors in Express routes, then proposes a promise middleware that centralizes response handling while still allowing special cases like redirects and streams.
Node.js Best Practices — Error Handling and Logging
The article recommends documenting API errors with GraphQL, exiting on unknown errors, logging with mature tools, testing error flows, monitoring app health, and catching unhandled promise rejections.
A Monadic Approach to Error Handling in Collection Pipelines
Michael Feathers shows how chained computation can carry both results and errors in a single pipeline, using a Ruby version of Haskell’s Either to record validation failures while skipping later stages.
