Add a method to get the failure reason of SelectorParseExceptions

This commit is contained in:
jmp 2020-10-30 20:06:27 -07:00 committed by Alexander Söderberg
parent a04e3f92cb
commit e6af4e6caa
5 changed files with 18 additions and 4 deletions

View file

@ -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
*