Class JDACException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.kaktushose.jdac.exceptions.internal.JDACException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConfigurationException, InternalException, InvalidDeclarationException, ParsingException

Base exception for all exceptions thrown by JDA-Commands.
See Also:
Implementation Note:
Error messages can be loaded from a Fluava bundle file called "jdac_internal_en.ftl" located in the resources folder.
  • Field Details

    • errorMessages

      protected static final dev.goldmensch.fluava.Bundle errorMessages
  • Constructor Details

    • JDACException

      public JDACException(String key)
      Creates a new JDACException and loads the error message from the given key.
      Parameters:
      key - the key of the error message
    • JDACException

      public JDACException(String key, Entry... placeholder)
      Creates a new JDACException, loads the error message from the given key and inserts the placeholders.
      Parameters:
      key - the key of the error message
      placeholder - the placeholders to insert
    • JDACException

      public JDACException(String key, Throwable cause)
      Creates a new JDACException and loads the error message from the given key and cause.
      Parameters:
      key - the key of the error message
      cause - the cause of the exception
    • JDACException

      public JDACException(String key, Throwable cause, Entry... placeholder)
      Creates a new JDACException with the given cause, loads the error message from the given key and inserts the placeholders.
      Parameters:
      key - the key of the error message
      cause - the cause of the exception
      placeholder - the placeholders to insert
  • Method Details

    • errorMessage

      public static String errorMessage(String key)
      Retrieves an error message from the error bundle.
      Parameters:
      key - the key of the error message
      Returns:
      the error message
    • errorMessage

      public static String errorMessage(String key, Entry... placeholder)
      Retrieves an error message from the error bundle and inserts the placeholders.
      Parameters:
      key - the key of the error message
      placeholder - the placeholders to insert
      Returns:
      the error message