-
Eike Cochu authored
updated import option exception handling
Eike Cochu authoredupdated import option exception handling
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ExecutionException.java 749 B
package de.vipra.cmd;
import java.util.List;
public class ExecutionException extends Exception {
private static final long serialVersionUID = 1L;
private List<Exception> exceptions;
public ExecutionException(String msg) {
super(msg);
}
public ExecutionException(Exception e) {
super(e);
}
public ExecutionException(List<Exception> e) {
this.exceptions = e;
}
@Override
public String getMessage() {
if (exceptions == null) {
return super.getMessage();
} else if (exceptions.size() == 1) {
return exceptions.get(0).getMessage();
} else {
StringBuilder sb = new StringBuilder("multiple errors:");
for (Exception e : exceptions) {
sb.append("\n " + e.getMessage());
}
return sb.toString();
}
}
}