diff --git a/Model/src/main/java/org/gusdb/wdk/model/WdkModelException.java b/Model/src/main/java/org/gusdb/wdk/model/WdkModelException.java index 5ce19e94d..557379771 100644 --- a/Model/src/main/java/org/gusdb/wdk/model/WdkModelException.java +++ b/Model/src/main/java/org/gusdb/wdk/model/WdkModelException.java @@ -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