Name

raise method

Synopsis

raise exception_class, message
raise exception_object
raisemessage
raise

Raises an exception. Assumes RuntimeError if no exception_class is specified. Calling raise without arguments in a rescue clause re-raises the exception. Doing so outside a rescue clause raises a message-less RuntimeError.

Get Ruby in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.