Back to Baml

Exception Handling

beps/docs/proposals/BEP-001-exceptions/README.md

0.222.01.2 KB
Original Source

BEP-001: Exception Handling

Leave comments on either

This proposal defines BAML's error handling mechanism: Universal Catch.

The core idea: catch is an operator that attaches to any scope—functions, loops, or expressions—without requiring structural changes to existing code.

Document Structure

DocumentPurpose
00_background.mdError handling landscape and requirements
01_proposal.mdUniversal Catch syntax specification
02_learn.mdPractical guide and FAQ
03_alternatives.mdRejected designs and rationale
04_tooling.mdIDE and compiler capabilities
05_deviations_from_ts.mdDifferences from TypeScript/JavaScript
06_proposal_safe.mdThe safe keyword for strict exhaustiveness

Start with 00_background.md for context, then 01_proposal.md for the syntax.