Fixed exception handling in util when a message is present

This commit is contained in:
nsingh
2017-01-05 11:28:07 -08:00
parent 5da35b7499
commit c5f0457ecc

View File

@@ -76,8 +76,13 @@ public class ExceptionUtil {
return new ExecutionException(cause);
}
public static Object exception(String string, Throwable error) {
return exception(error);
public static Object exception(String message, Throwable error) {
if (message != null) {
// Wrap only if there is an additional message
return new ExecutionException(message, error);
} else {
return exception(error);
}
}
}