Package org.spongepowered.configurate
Class ConfigurateException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.spongepowered.configurate.ConfigurateException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ParsingException,SerializationException
Any sort of error thrown within Configurate.
Configurate's errors are designed to provide a view of as
many errors as possible within one configuration tree, through the
suppressed exceptions
- Since:
- 4.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new unknown exception.ConfigurateException(@Nullable String message, @Nullable Throwable cause) Create a new exception with informational message and cause.ConfigurateException(String message) Create a new exception at unknown path with provided informational message.ConfigurateException(Throwable cause) Create a new exception with a cause and unknown message.ConfigurateException(ConfigurationNode pos, @Nullable String message, @Nullable Throwable cause) Create a new exception pre-initialized with path, message, and cause.ConfigurateException(ConfigurationNode pos, String message) Create a new exception pre-initialized with path and message.ConfigurateException(ConfigurationNode pos, Throwable cause) Create a new exception pre-initialized with path and cause.ConfigurateException(NodePath path, @Nullable String message, @Nullable Throwable cause) Create a new exception pre-initialized with path, message, and cause. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringGet a description of the location of this error, with path included.voidInitialize path if none has been set.path()Get the path associated with this failure.@Nullable StringGet the exception's message without any extra formatting.static ConfigurateExceptionwrap(ConfigurationNode source, IOException ex) Given an unknownIOException, return it as a Configurate type.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ConfigurateException
public ConfigurateException()Create a new unknown exception.- Since:
- 4.0.0
-
ConfigurateException
Create a new exception at unknown path with provided informational message.- Parameters:
message- informational message- Since:
- 4.0.0
-
ConfigurateException
Create a new exception with a cause and unknown message.- Parameters:
cause- the cause of this exception- Since:
- 4.0.0
-
ConfigurateException
Create a new exception with informational message and cause.- Parameters:
message- the informational messagecause- the cause of the exception- Since:
- 4.0.0
-
ConfigurateException
Create a new exception pre-initialized with path and message.- Parameters:
pos- node where the error occurredmessage- message describing the error- Since:
- 4.0.0
-
ConfigurateException
Create a new exception pre-initialized with path and cause.- Parameters:
pos- node where the error occurredcause- direct cause of this exception- Since:
- 4.0.0
-
ConfigurateException
public ConfigurateException(ConfigurationNode pos, @Nullable String message, @Nullable Throwable cause) Create a new exception pre-initialized with path, message, and cause.- Parameters:
pos- node where the error occurredmessage- message describing the errorcause- direct cause of this exception- Since:
- 4.0.0
-
ConfigurateException
Create a new exception pre-initialized with path, message, and cause.- Parameters:
path- path to the node where the error occurredmessage- message describing the errorcause- direct cause of this exception- Since:
- 4.0.0
-
-
Method Details
-
wrap
Given an unknownIOException, return it as a Configurate type.If the input
exis already aConfigurateException, this method returns the input value.- Parameters:
source- node where the source exception was thrownex- the source exception- Returns:
- an exception, either casted or wrapped
- Since:
- 4.0.0
-
path
Get the path associated with this failure.- Returns:
- the path
- Since:
- 4.0.0
-
initPath
Initialize path if none has been set.- Parameters:
path- new path- Since:
- 4.0.0
-
rawMessage
Get the exception's message without any extra formatting.- Returns:
- the raw message
- Since:
- 4.0.0
-
getMessage
Get a description of the location of this error, with path included.- Overrides:
getMessagein classThrowable- Returns:
- message
- Since:
- 4.0.0
-