Skip to content

trySets

Begins a block of code whose errors can be caught.

Use trySets to wrap code that might fail. If anything inside the block raises an error (via throwSets or otherwise), execution jumps to the matching catchSets block. Pair with finallySets to run cleanup code whether or not an error occurred. This is a placeholder Setswana name — the canonical Setswana translation will be chosen later.

trySets { ... } catchSets (e) { ... }
Catch an error thrown inside a try block
trySets {
  throwSets "phoso";
} catchSets (e) {
  kwala(e);
}

catchSets, finallySets, throwSets