Skip to content

leka

Begins a block of code whose errors can be caught.

Use leka to wrap code that might fail. If anything inside the block raises an error (via latlha or otherwise), execution jumps to the matching tshwara block. Pair with kgabagare to run cleanup code whether or not an error occurred.

leka { ... } tshwara (e) { ... }
Catch an error thrown inside a try block
leka {
  latlha "phoso";
} tshwara (e) {
  kwala(e);
}

tshwara, kgabagare, latlha