Class ParsingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.spongepowered.configurate.ConfigurateException
org.spongepowered.configurate.loader.ParsingException
- All Implemented Interfaces:
Serializable
Indicates an error that occurred while parsing the configuration.
These exceptions can include a specific position reference within a file.
- Since:
- 4.0.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Indicates a line or column is unknown. -
Constructor Summary
ConstructorsConstructorDescriptionParsingException
(int line, int column, @Nullable String context, @Nullable String message, @Nullable Throwable cause) Create a new parsing exception.ParsingException
(ConfigurationNode position, int line, int column, @Nullable String context, @Nullable String message, @Nullable Throwable cause) Create a new parsing exception.ParsingException
(ConfigurationNode position, int line, int column, String context, @Nullable String message) Create a new parsing exception. -
Method Summary
Modifier and TypeMethodDescriptionint
column()
Column most closely associated with the error.@Nullable String
context()
A context line from the source, if available.@Nullable String
Get a description of the location of this error, with path included.int
line()
Line most closely associated with this error.static ParsingException
wrap
(ConfigurationNode source, IOException ex) Given an unknownIOException
, return it as a Configurate type.Methods inherited from class org.spongepowered.configurate.ConfigurateException
initPath, path, rawMessage
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
UNKNOWN_POS
Indicates a line or column is unknown.- See Also:
-
-
Constructor Details
-
ParsingException
public ParsingException(ConfigurationNode position, int line, int column, String context, @Nullable String message) Create a new parsing exception.- Parameters:
position
- position in the node structure where the error occurredline
- line with issuecolumn
- column in the linecontext
- the line in a file where the error occurredmessage
- message describing the error- Since:
- 4.0.0
-
ParsingException
public ParsingException(int line, int column, @Nullable String context, @Nullable String message, @Nullable Throwable cause) Create a new parsing exception.- Parameters:
line
- line with issuecolumn
- column in the linecontext
- the line in a file where the error occurredmessage
- message describing the errorcause
- direct cause- Since:
- 4.0.0
-
ParsingException
public ParsingException(ConfigurationNode position, int line, int column, @Nullable String context, @Nullable String message, @Nullable Throwable cause) Create a new parsing exception.- Parameters:
position
- position in the node structure where the error occurredline
- line with issuecolumn
- column in the linecontext
- the line in a file where the error occurredmessage
- message describing the errorcause
- direct cause- Since:
- 4.0.0
-
-
Method Details
-
wrap
Given an unknownIOException
, return it as a Configurate type.If the input
ex
is already aParsingException
, 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
-
line
Line most closely associated with this error.- Returns:
- line, or
-1
for unknown - Since:
- 4.0.0
-
column
Column most closely associated with the error.- Returns:
- column, or
-1
for unknown - Since:
- 4.0.0
-
context
A context line from the source, if available.- Returns:
- context line
- Since:
- 4.0.0
-
getMessage
Description copied from class:ConfigurateException
Get a description of the location of this error, with path included.- Overrides:
getMessage
in classConfigurateException
- Returns:
- message
-