Skip to content

Commit f87b94e

Browse files
committed
Merge remote-tracking branch 'jsimomaa/master'
Merge pr (zafarkhaja#39)
2 parents 0338dc4 + 8c87bae commit f87b94e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/main/java/com/github/zafarkhaja/semver/ParseException.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ public ParseException(String message, UnexpectedCharacterException cause) {
5858
super(message);
5959
initCause(cause);
6060
}
61+
62+
/**
63+
* Returns the message of this exception. If the message is not set,
64+
* returns the string representation provided by toString()
65+
*
66+
* @return the message of this exception
67+
*/
68+
@Override
69+
public String getMessage() {
70+
if (super.getMessage() != null)
71+
return super.getMessage();
72+
return toString();
73+
}
6174

6275
/**
6376
* Returns the string representation of this exception.

0 commit comments

Comments
 (0)