✨ Add a method to get the failure reason of SelectorParseExceptions
This commit is contained in:
parent
a04e3f92cb
commit
e6af4e6caa
5 changed files with 18 additions and 4 deletions
|
|
@ -37,6 +37,7 @@ public final class SelectorParseException extends ParserException {
|
|||
|
||||
private static final long serialVersionUID = 1900826717897819065L;
|
||||
private final String input;
|
||||
private final FailureReason reason;
|
||||
|
||||
/**
|
||||
* Construct a new EntitySelector parse exception
|
||||
|
|
@ -58,6 +59,7 @@ public final class SelectorParseException extends ParserException {
|
|||
reason.getCaption(),
|
||||
CaptionVariable.of("input", input)
|
||||
);
|
||||
this.reason = reason;
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
|
|
@ -70,6 +72,16 @@ public final class SelectorParseException extends ParserException {
|
|||
return input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reason of failure for the selector parser
|
||||
*
|
||||
* @return Failure reason
|
||||
* @since 1.2.0
|
||||
*/
|
||||
public @NonNull FailureReason getFailureReason() {
|
||||
return this.reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reasons for which selector parsing may fail
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue