Note: information on this page refers to Ceylon 1.1, not to the current release.

throws annotation

The throws annotation documents an exception that can be thrown by a function, value, or class.


The annotation accepts a program element reference expression identifying a class of Exception that is thrown, along with a description of the conditions that cause the exception.

throws (`class AssertionError`, "if `i < 0`")
void example(Integer i) {
    assert (i>=0);


The throws annotation is processed by the ceylon doc tool. Its description is assumed to contain Markdown formatted text.

See also