diff --git a/src/main/java/com/github/zafarkhaja/semver/UnexpectedCharacterException.java b/src/main/java/com/github/zafarkhaja/semver/UnexpectedCharacterException.java index 52c6c0e..485d7c6 100644 --- a/src/main/java/com/github/zafarkhaja/semver/UnexpectedCharacterException.java +++ b/src/main/java/com/github/zafarkhaja/semver/UnexpectedCharacterException.java @@ -48,8 +48,8 @@ public class UnexpectedCharacterException extends ParseException { private final CharType[] expected; /** - * Constructs a {@code UnexpectedCharacterException} instance - * with the unexpected character and the expected types. + * Constructs a {@code UnexpectedCharacterException} instance with + * the wrapped {@code UnexpectedElementException} exception. * * @param cause the wrapped exception */ @@ -58,6 +58,17 @@ public class UnexpectedCharacterException extends ParseException { expected = (CharType[]) cause.getExpectedElementTypes(); } + /** + * Constructs a {@code UnexpectedCharacterException} instance + * with the unexpected character and the expected types. + * + * @param cause the wrapped exception + */ + UnexpectedCharacterException(Character unexpected, CharType... expected) { + this.unexpected = unexpected; + this.expected = expected; + } + /** * Gets the unexpected character. *