Skip to content

Commit

Permalink
Merge branch 'release/0.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Dec 22, 2019
2 parents bd59cc5 + c53df6f commit 7133176
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion com.io7m.blackthorne.api/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>com.io7m.blackthorne</artifactId>
<groupId>com.io7m.blackthorne</groupId>
<version>0.0.4</version>
<version>0.0.5</version>
</parent>

<artifactId>com.io7m.blackthorne.api</artifactId>
Expand Down
Expand Up @@ -154,7 +154,7 @@ public void warning(
BTParseError.builder()
.setException(e)
.setSeverity(BTParseErrorType.Severity.WARNING)
.setMessage(e.getMessage())
.setMessage(messageOrException(e))
.setLexical(this.currentLexical())
.build());
}
Expand All @@ -168,7 +168,7 @@ public void error(
BTParseError.builder()
.setException(e)
.setSeverity(BTParseErrorType.Severity.ERROR)
.setMessage(e.getMessage())
.setMessage(messageOrException(e))
.setLexical(this.currentLexical())
.build());
}
Expand All @@ -183,12 +183,24 @@ public void fatalError(
BTParseError.builder()
.setException(e)
.setSeverity(BTParseErrorType.Severity.ERROR)
.setMessage(e.getMessage())
.setMessage(messageOrException(e))
.setLexical(this.currentLexical())
.build());
throw e;
}

private static String messageOrException(
final Exception e)
{
final var messageOrNull = e.getMessage();
if (messageOrNull == null) {
return String.format(
"No error message provided for exception %s",
e.getClass().getName());
}
return messageOrNull;
}

private LexicalPosition<URI> currentLexical()
{
final LexicalPosition<URI> lexicalPosition;
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.blackthorne.tests/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>com.io7m.blackthorne</artifactId>
<groupId>com.io7m.blackthorne</groupId>
<version>0.0.4</version>
<version>0.0.5</version>
</parent>

<artifactId>com.io7m.blackthorne.tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -13,7 +13,7 @@

<groupId>com.io7m.blackthorne</groupId>
<artifactId>com.io7m.blackthorne</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
<packaging>pom</packaging>

<name>com.io7m.blackthorne</name>
Expand Down

0 comments on commit 7133176

Please sign in to comment.