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
public sealed class JDACException
extends RuntimeException
permits 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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final dev.goldmensch.fluava.Bundle -
Constructor Summary
ConstructorsConstructorDescriptionJDACException(String key) Creates a new JDACException and loads the error message from the given key.JDACException(String key, Entry... placeholder) Creates a new JDACException, loads the error message from the given key and inserts the placeholders.JDACException(String key, Throwable cause) Creates a new JDACException and loads the error message from the given key and cause.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. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringerrorMessage(String key) Retrieves an error message from the error bundle.static StringerrorMessage(String key, Entry... placeholder) Retrieves an error message from the error bundle and inserts the placeholders.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
errorMessages
protected static final dev.goldmensch.fluava.Bundle errorMessages
-
-
Constructor Details
-
JDACException
Creates a new JDACException and loads the error message from the given key.- Parameters:
key- the key of the error message
-
JDACException
Creates a new JDACException, loads the error message from the given key and inserts the placeholders.- Parameters:
key- the key of the error messageplaceholder- the placeholders to insert
-
JDACException
-
JDACException
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 messagecause- the cause of the exceptionplaceholder- the placeholders to insert
-
-
Method Details
-
errorMessage
-
errorMessage
Retrieves an error message from the error bundle and inserts the placeholders.- Parameters:
key- the key of the error messageplaceholder- the placeholders to insert- Returns:
- the error message
-