Raise Statement

The Raise statement is used to raise an exception to the next level in the calling chain.

# Syntax

Raise expression

Expression must evaluate to an object that is a subclass of RuntimeException -- and will be the object that is passed to any exception handlers.

# Example

You might want to use Raise to handle certain types of exceptions differently than others. For example, if you want to handle all exceptions except out of bounds exceptions, you can raise only those and catch the others. For example

Exception err as OutOfBoundsException
Raise Err
Exception err
MsgBox "An exception occurred here. Never mind."

# See Also

Function statement; RuntimeException class; Exception, Try blocks.