You are viewing an older version of the site. Click here to view
the latest version of this page. (This may be a dead link, if so, try the root page of the docs
here.)
== throw ==
exception |- ! scope="row" | Throws | [[../objects/ms.lang.FormatException|ms.lang.FormatException]] |- ! scope="row" | Since | 3.1.2 |- ! scope="row" | Restricted |
This function causes an exception to be thrown. The exceptionType may be any valid exception type.
=== Vital Info ===
{| style="width: 40%;" cellspacing="1" cellpadding="1" border="1" class="wikitable"
|-
! scope="col" width="20%" |
! scope="col" width="80%" |
|-
! scope="row" | Name
| throw
|-
! scope="row" | Returns
| nothing
|-
! scope="row" | Usages
| exceptionType, msg, [causedBy] exception |- ! scope="row" | Throws | [[../objects/ms.lang.FormatException|ms.lang.FormatException]] |- ! scope="row" | Since | 3.1.2 |- ! scope="row" | Restricted |
No
|-
! scope="row" | Optimizations
| None
|}The core exception types are:
com.commandhelper.BadEntityException, com.commandhelper.BadEntityTypeException, com.commandhelper.EnchantmentException, com.commandhelper.InvalidPluginException, com.commandhelper.InvalidWorldException, com.commandhelper.PlayerOfflineException, com.commandhelper.PluginChannelException, com.commandhelper.ScoreboardException, com.commandhelper.UnageableMobException, com.commandhelper.UntameableMobException, ms.lang.BindException, ms.lang.ByteArrayReadOnlyException, ms.lang.CastException, ms.lang.ClassDefinitionError, ms.lang.Error, ms.lang.EventException, ms.lang.Exception, ms.lang.FormatException, ms.lang.IOException, ms.lang.IllegalArgumentException, ms.lang.IncludeException, ms.lang.IndexOverflowException, ms.lang.InsufficientArgumentsException, ms.lang.InsufficientPermissionException, ms.lang.InterruptedException, ms.lang.InvalidProcedureException, ms.lang.LengthException, ms.lang.NotFoundException, ms.lang.NullPointerException, ms.lang.PluginInternalException, ms.lang.RangeException, ms.lang.ReadOnlyException, ms.lang.SQLException, ms.lang.SecurityException, ms.lang.ShellException, ms.lang.StackOverflowError, ms.lang.Throwable, ms.lang.UnsupportedOperationException, and ms.lang.auth.OAuthException
There may be other exception types as well, refer to the documentation of any extensions you have installed.
=== Usages ===
throw(exceptionType, msg, [causedBy])
throw(exception)=== Examples === Sorry, there are no examples for this function! :( ===See Also===
[[API/functions/try.html|try]]
, [[Exceptions|Learning Trail: Exceptions]]Find a bug in this page? Edit this page yourself, then submit a pull request. (Note this page is automatically generated from the documentation in the source code.)