Class ScriptExceptionEvent
java.lang.Object
org.bukkit.event.Event
dev.magicmq.pyspigot.bukkit.event.ScriptEvent
dev.magicmq.pyspigot.bukkit.event.ScriptExceptionEvent
Called when a script throws an unhandled error/exception. This event could be called asynchronously if the exception occurred in an asynchronous context. To check if the event is asynchronous, call
Event.isAsynchronous()
The exception will be a PyException, which will include Java exceptions thrown by calls to Java code from scripts. Use Throwable.getCause() to determine if there was an underlying Java exception.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionScriptExceptionEvent(dev.magicmq.pyspigot.manager.script.Script script, PyException exception, boolean async) -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet if the exception should be reported to console and/or a script's log file.Get thePyExceptionthat was thrown.static HandlerListvoidsetReportException(boolean reportException) Set if the exception should be reported to console and/or the script's log file.Methods inherited from class dev.magicmq.pyspigot.bukkit.event.ScriptEvent
getScriptMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ScriptExceptionEvent
public ScriptExceptionEvent(dev.magicmq.pyspigot.manager.script.Script script, PyException exception, boolean async) - Parameters:
script- The script that caused the error/exceptionexception- ThePyExceptionthat was thrownasync- Whether the exception occurred in an asychronous context
-
-
Method Details
-
getException
Get thePyExceptionthat was thrown.- Returns:
- The
PyExceptionthat was thrown
-
doReportException
public boolean doReportException()Get if the exception should be reported to console and/or a script's log file.- Returns:
- True if the exception should be reported to console and/or a script's log file, false if otherwise
-
setReportException
public void setReportException(boolean reportException) Set if the exception should be reported to console and/or the script's log file.- Parameters:
reportException- Whether the exception should be reported.
-
getHandlers
- Overrides:
getHandlersin classScriptEvent
-
getHandlerList
-