Class RuntimeErrorFilter

java.lang.Object
org.skriptlang.skript.log.runtime.RuntimeErrorFilter

public class RuntimeErrorFilter extends Object
Handles filtering of runtime errors based on their level and predefined limits. Uses the concept of 'frames' to track the number of errors and warnings that are allowed in a given period. Use test(RuntimeError) to determine if a runtime error should be printed or not. Printing the frame outputs can be done via getErrorFrame() and getWarningFrame().
  • Field Details

    • NO_FILTER

      public static final RuntimeErrorFilter NO_FILTER
      A filter that does not filter anything, allowing all errors and warnings to be printed. Modifications to its limits will do nothing, and the returned frames will hold no relevant data.
  • Constructor Details

  • Method Details

    • test

      public boolean test(@NotNull @NotNull RuntimeError error)
      Tests whether a runtime error should be printed or not.
      Parameters:
      error - True if it should be printed, false if not.
    • setErrorFrameLimits

      public void setErrorFrameLimits(Frame.FrameLimit limits)
    • setWarningFrameLimits

      public void setWarningFrameLimits(Frame.FrameLimit limits)
    • getErrorFrame

      public Frame getErrorFrame()
      Returns:
      The frame containing emitted errors.
    • getWarningFrame

      public Frame getWarningFrame()
      Returns:
      The frame containing emitted warnings.