Class RuntimeErrorCatcher
java.lang.Object
org.skriptlang.skript.log.runtime.RuntimeErrorCatcher
- All Implemented Interfaces:
RuntimeErrorConsumer
A
RuntimeErrorConsumer
to be used in RuntimeErrorManager
to catch RuntimeError
s.
This should always be used with start()
and stop()
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClear all cachedRuntimeError
s.Clears all cachedFrame.FrameOutput
s.@UnmodifiableView List
<RuntimeError> Gets all the cachedRuntimeError
s.@UnmodifiableView List
<Map.Entry<Frame.FrameOutput, Level>> void
printError
(RuntimeError error) Prints a single error with all its information.void
printFrameOutput
(Frame.FrameOutput output, Level level) Prints the output of a frame, including skipped errors, timeouts, and whatever other information required.start()
Starts thisRuntimeErrorCatcher
, removing allRuntimeErrorConsumer
s fromRuntimeErrorManager
and storing them instoredConsumers
.void
stop()
Stops thisRuntimeErrorCatcher
, removing fromRuntimeErrorManager
and restoring the previousRuntimeErrorConsumer
s fromstoredConsumers
.
-
Constructor Details
-
RuntimeErrorCatcher
public RuntimeErrorCatcher()
-
-
Method Details
-
start
Starts thisRuntimeErrorCatcher
, removing allRuntimeErrorConsumer
s fromRuntimeErrorManager
and storing them instoredConsumers
. Makes thisRuntimeErrorCatcher
the onlyRuntimeErrorConsumer
inRuntimeErrorManager
to catchRuntimeError
s.- Returns:
- This
RuntimeErrorCatcher
-
stop
public void stop()Stops thisRuntimeErrorCatcher
, removing fromRuntimeErrorManager
and restoring the previousRuntimeErrorConsumer
s fromstoredConsumers
. Prints all cachedRuntimeError
s,cachedErrors
, and cachedFrame.FrameOutput
s,cachedFrames
. -
getCachedErrors
Gets all the cachedRuntimeError
s. -
getCachedFrames
-
clearCachedErrors
Clear all cachedRuntimeError
s. -
clearCachedFrames
Clears all cachedFrame.FrameOutput
s. -
printError
Description copied from interface:RuntimeErrorConsumer
Prints a single error with all its information.- Specified by:
printError
in interfaceRuntimeErrorConsumer
- Parameters:
error
- The error to print.
-
printFrameOutput
Description copied from interface:RuntimeErrorConsumer
Prints the output of a frame, including skipped errors, timeouts, and whatever other information required.- Specified by:
printFrameOutput
in interfaceRuntimeErrorConsumer
- Parameters:
output
- An output object containing unmodifiable views of the frame data.level
- The severity of this frame (error vs warning).
-