Interface RuntimeErrorProducer

All Known Subinterfaces:
SyntaxRuntimeErrorProducer
All Known Implementing Classes:
ExprDisplayBillboard, ExprDisplayGlowOverride, ExprDisplayHeightWidth, ExprDisplayInterpolation, ExprDisplayShadow, ExprDisplayTeleportDuration, ExprDisplayTransformationRotation, ExprDisplayTransformationScaleTranslation, ExprDisplayViewRange, ExprItemDisplayTransform, ExprItemOfEntity, ExprLootContextEntity, ExprLootContextLocation, ExprLootContextLooter, ExprLootContextLuck, ExprLootTable, ExprLootTableSeed, ExprLoveTime, ExprQuaternionAxisAngle, ExprTag, ExprTagKey, ExprTextDisplayAlignment, ExprTextDisplayLineWidth, ExprTextDisplayOpacity, ExprTextOf, ch.njol.skript.expressions.base.SimplePropertyExpression

public interface RuntimeErrorProducer
A RuntimeErrorProducer can throw runtime errors in a standardized and controlled manner.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    error(String message)
    Dispatches a runtime error with the given text.
    default void
    error(String message, String highlight)
    Dispatches a runtime error with the given text and syntax highlighting.
    @NotNull ErrorSource
    Gets the source of the errors produced by the implementing class.
     
    default void
    warning(String message)
    Dispatches a runtime warning with the given text.
    default void
    warning(String message, String highlight)
    Dispatches a runtime warning with the given text and syntax highlighting.
  • Method Details

    • getErrorSource

      @Contract(" -> new") @NotNull @NotNull ErrorSource getErrorSource()
      Gets the source of the errors produced by the implementing class. Most extending interfaces should provide a default implementation of this method for ease of use.
      Returns:
      The source of the error.
      See Also:
    • error

      default void error(String message)
      Dispatches a runtime error with the given text. Metadata will be provided along with the message, including line number, the docs name of the producer, and the line content.
      Implementations should ensure they call super() to print the error.
      Parameters:
      message - The text to display as the error message.
    • error

      default void error(String message, String highlight)
      Dispatches a runtime error with the given text and syntax highlighting. Metadata will be provided along with the message, including line number, the docs name of the producer, and the line content.
      Implementations should ensure they call super() to print the error.
      Parameters:
      message - The text to display as the error message.
      highlight - The text to highlight in the parsed syntax.
    • warning

      default void warning(String message)
      Dispatches a runtime warning with the given text. Metadata will be provided along with the message, including line number, the docs name of the producer, and the line content.
      Implementations should ensure they call super() to print the warning.
      Parameters:
      message - The text to display as the error message.
    • warning

      default void warning(String message, String highlight)
      Dispatches a runtime warning with the given text and syntax highlighting. Metadata will be provided along with the message, including line number, the docs name of the producer, and the line content.
      Implementations should ensure they call super() to print the warning.
      Parameters:
      message - The text to display as the error message.
      highlight - The text to highlight in the parsed syntax.
    • getRuntimeErrorManager

      default RuntimeErrorManager getRuntimeErrorManager()
      Returns:
      The manager this producer will send errors to.