KScript docs
EN

Error codes

KS5016

A known error can escape the script. The checker reports the error types at the top-level statement that can raise them. A helper may pass an error to its caller. Add a matching catch at the level that can handle it. A catch on a function, method or type propagates the error when it falls through or returns null. Ordinary try blocks can handle an error and continue.

The checker follows resolved function and method calls and their documented @throws types. Calls through dynamically selected callbacks may raise additional errors. Test bodies run under the test runner, and expect_error handles errors while checking the expected outcome.