Skip to content

Errors

There are no exceptions. A failure is a value.

let t = run("npm test")? // pass a failure up to the caller
let n = read(./count.txt) or { "0" } // handle it here

An unhandled failure stops the script.

Errors come in families. NotFound and Expired are both a SessionError, so a handler can catch the family or the exact case, and match tells you if you forgot one.