Skip to content

Commit

Permalink
Merge pull request #1168 from OSGP/feature/SMHE-1748-add-nullsafe-get…
Browse files Browse the repository at this point in the history
…ErrorMessage

SMHE-1748: Add nullsafe getErrorMessage
  • Loading branch information
abolder authored and Marcel-Jansen committed Jan 31, 2024
1 parent 724d33c commit 32a8dfd
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ public OsgpJasperException(final String message) {
public JasperError getJasperError() {
return this.jasperError;
}

/**
* Returns the error message from the JasperError if it is not null, otherwise the message from
* this exception.
*
* @return the error message
*/
public String getErrorMessage() {
return this.jasperError != null ? this.jasperError.getMessage() : this.getMessage();
}
}

0 comments on commit 32a8dfd

Please sign in to comment.