throw.Rd
Throws an exception similar to stop()
, but with support for
Exception
classes. The first argument (object
) is by
default pasted together with other arguments (...
) and with separator
sep=""
. For instance, to throw an exception, write
throw("Value out of range: ", value, ".")
.
which is short for
throw(Exception("Value out of range: ", value, "."))
.
Note that throw()
can be defined for classes inheriting
Exception
, which can then be caught (or not)
using tryCatch()
.
# Default S3 method
throw(...)
Returns nothing.
See the Exception
class for more detailed information.