Class RuntimeErrorCatcher
java.lang.Object
org.skriptlang.skript.log.runtime.RuntimeErrorCatcher
- All Implemented Interfaces:
RuntimeErrorConsumer
A
RuntimeErrorConsumer to be used in RuntimeErrorManager to catch RuntimeErrors.
This should always be used with start() and stop().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClear all cachedRuntimeErrors.@UnmodifiableView List<RuntimeError> Gets all the cachedRuntimeErrors.@Nullable RuntimeErrorFiltervoidprintError(RuntimeError error) Prints a single error with all its information.voidprintFrameOutput(Frame.FrameOutput output, Level level) Prints the output of a frame, including skipped errors, timeouts, and whatever other information required.start()Starts thisRuntimeErrorCatcher, removing allRuntimeErrorConsumers fromRuntimeErrorManagerand storing them instoredConsumers.voidstop()Stops thisRuntimeErrorCatcher, removing fromRuntimeErrorManagerand restoring the previousRuntimeErrorConsumers fromstoredConsumers.
-
Constructor Details
-
RuntimeErrorCatcher
public RuntimeErrorCatcher()
-
-
Method Details
-
getFilter
- Specified by:
getFilterin interfaceRuntimeErrorConsumer- Returns:
- The filter to use when checking if this consumer should print an error. Defaults to the standard
config-driven filter. If no filter should be used, return
RuntimeErrorFilter.NO_FILTER. This value MUST be effectively final.
-
start
Starts thisRuntimeErrorCatcher, removing allRuntimeErrorConsumers fromRuntimeErrorManagerand storing them instoredConsumers. Makes thisRuntimeErrorCatcherthe onlyRuntimeErrorConsumerinRuntimeErrorManagerto catchRuntimeErrors.- Returns:
- This
RuntimeErrorCatcher
-
stop
public void stop()Stops thisRuntimeErrorCatcher, removing fromRuntimeErrorManagerand restoring the previousRuntimeErrorConsumers fromstoredConsumers. Prints all cachedRuntimeErrors,cachedErrors. -
getCachedErrors
Gets all the cachedRuntimeErrors. -
clearCachedErrors
Clear all cachedRuntimeErrors. -
printError
Description copied from interface:RuntimeErrorConsumerPrints a single error with all its information.- Specified by:
printErrorin interfaceRuntimeErrorConsumer- Parameters:
error- The error to print.
-
printFrameOutput
Description copied from interface:RuntimeErrorConsumerPrints the output of a frame, including skipped errors, timeouts, and whatever other information required.- Specified by:
printFrameOutputin interfaceRuntimeErrorConsumer- Parameters:
output- An output object containing unmodifiable views of the frame data.level- The severity of this frame (error vs warning).
-