Learning on Web Dev Open is free for all.

Systems Thinking > Failure, deliberatelyAn error that tells you where it came from
Phase 03Failure, deliberately149 of 434

An error that tells you where it came from

Build an error type with a cause chain, structured fields, and a serialisation that survives being sent to a log.

Build40 minAI implements

Build this in your own editor

This one runs on your machine rather than in the browser workbench. Work to the outcomes below, then come back and mark it complete.

You should now be able to

  • Attach machine-readable context to a thrown error
  • Preserve the original failure through a rethrow
Ask the community

Loading…