# throw
Throw an error, triggering the nearest `try` catch handler.
## Syntax
[throw $msg]
## Examples
try { if ($x < 0) { [throw "x must be non-negative"] } [do-work $x] } catch { $err | echo "caught:" $err }
## Returns
Does not return — control jumps to the enclosing `catch`.
## See Also
`try`, `err`, `ok`, `unwrap`