Hymn Script
Home Learn Play Download Source Dark

Exceptions



Exceptions are used to communicate something went wrong.

try {
  throw "Oh no!"
} except error {
  echo error
}
echo "So anyways..."

Catching an exception always provides a string value.

Exceptions always stop the current execution and jump to the closest catch block on the stack. If there is no catch block, then the program ends.


Back to Loops Learn Imports