Kaya 0.4.4 reference for Builtins::exceptionMessage

List of functions and data types in Builtins

String exceptionMessage(Exception e)

Arguments

Usage

Return the error message in an Exception. This is useful for determining the exception caught by a catch-all clause, but it is preferable to catch Exceptions by name.

try {
    functionThatMayGoWrong(a,b,c);
} catch(e) {
    putStrLn("Something went wrong: "+exceptionMessage(e));
}

Related

kaya@kayalang.org | Last modified 29 November 2011 | Supported by Durham CompSoc | Powered by Kaya