You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases the detailMessage field is null for ParseException (and inheriting exceptions) resulting in non-descriptive logging with SLF4J and Logback.
I know that the leading v is the cause for this exception. However, the code above produces the following output:
15:59:12.485 [main] ERROR Main - Could not parse version
com.github.zafarkhaja.semver.UnexpectedCharacterException: null
at com.github.zafarkhaja.semver.VersionParser.consumeNextCharacter(VersionParser.java:516)
at com.github.zafarkhaja.semver.VersionParser.digits(VersionParser.java:448)
at com.github.zafarkhaja.semver.VersionParser.numericIdentifier(VersionParser.java:408)
at com.github.zafarkhaja.semver.VersionParser.parseVersionCore(VersionParser.java:285)
at com.github.zafarkhaja.semver.VersionParser.parseValidSemVer(VersionParser.java:255)
at com.github.zafarkhaja.semver.VersionParser.parseValidSemVer(VersionParser.java:195)
at com.github.zafarkhaja.semver.Version.valueOf(Version.java:265)
at Main.main(Main.java:10)
which is not very descriptive.
I think this could be fixed quite simply with the following addition to ParseException:
@OverridepublicStringgetMessage() {
if (super.getMessage() != null)
returnsuper.getMessage();
returntoString();
}
The text was updated successfully, but these errors were encountered:
In some cases the
detailMessage
field is null forParseException
(and inheriting exceptions) resulting in non-descriptive logging withSLF4J
andLogback
.I have the following code sample:
I know that the leading
v
is the cause for this exception. However, the code above produces the following output:which is not very descriptive.
I think this could be fixed quite simply with the following addition to
ParseException
:The text was updated successfully, but these errors were encountered: