Skip to content

Commit

Permalink
Improve exception message in rare cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrdoherty committed Aug 21, 2024
1 parent 90ac411 commit c6eeee2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public static WdkModelException translateFrom(Exception e) {
}

public static WdkModelException translateFrom(Exception e, String newMessage) {
// if passed message is null, use name of original exception
if (newMessage == null) newMessage = e.getClass().getSimpleName();
// if exception is already a WdkModelException, simply return
if (e instanceof WdkModelException) return (WdkModelException)e;
// check underlying exception; a WdkModelException may simply have been wrapped
Expand Down

0 comments on commit c6eeee2

Please sign in to comment.