Class ScriptExceptionEvent

java.lang.Object
net.md_5.bungee.api.plugin.Event
dev.magicmq.pyspigot.bungee.event.ScriptEvent
dev.magicmq.pyspigot.bungee.event.ScriptExceptionEvent

public class ScriptExceptionEvent extends ScriptEvent
Called when a script throws an unhandled error/exception.

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.

  • Constructor Details

    • ScriptExceptionEvent

      public ScriptExceptionEvent(dev.magicmq.pyspigot.manager.script.Script script, PyException exception)
      Parameters:
      script - The script that caused the error/exception
      exception - The PyException that was thrown
  • Method Details

    • getException

      public PyException getException()
      Get the PyException that was thrown.
      Returns:
      The PyException that 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.