Skip to content
On this page

Expression: Exception Operations

Throwing Exceptions

Exceptions are thrown using the throw keyword. The expression after the throw keyword is the exception to be thrown. The exception must a subtype of Throwable.

throw $exception;

throw new Exception();

Licensed under either of the MIT License or the Apache License (Version 2.0), at your option.