Class RuntimeErrorFilter
java.lang.Object
org.skriptlang.skript.log.runtime.RuntimeErrorFilter
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final RuntimeErrorFilterA filter that does not filter anything, allowing all errors and warnings to be printed. -
Constructor Summary
ConstructorsConstructorDescriptionRuntimeErrorFilter(Frame.FrameLimit errorFrameLimits, Frame.FrameLimit warningFrameLimits) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetErrorFrameLimits(Frame.FrameLimit limits) voidbooleantest(@NotNull RuntimeError error) Tests whether a runtime error should be printed or not.
-
Field Details
-
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
-
RuntimeErrorFilter
-
-
Method Details
-
test
Tests whether a runtime error should be printed or not.- Parameters:
error- True if it should be printed, false if not.
-
setErrorFrameLimits
-
setWarningFrameLimits
-
getErrorFrame
- Returns:
- The frame containing emitted errors.
-
getWarningFrame
- Returns:
- The frame containing emitted warnings.
-