raise

raise
raise(string)
raise(exception [, string [, array]])
Instance Public methods

With no arguments, raises the exception in $! or raises a RuntimeError if $! is nil. With a single String argument, raises a RuntimeError with the string as a message. Otherwise, the first parameter should be the name of an Exception class (or an object that returns an Exception object when sent an exception message). The optional second parameter sets the message associated with the exception, and the third parameter is an array of callback information. Exceptions are caught by the rescue clause of begin...end blocks.

raise "Failed to create socket"
raise ArgumentError, "No parameters", caller
doc_ruby_on_rails
2015-04-17 11:38:06
Comments
Leave a Comment

Please login to continue.