blob: f061888e31bcb1c4c997bbfdd2422b2a99bcc0f5 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
package org.eclipse.osbp.preferences;
import java.util.HashSet;
import java.util.Set;
/**
* Helper exception class for exceptions while reading product configuration
*/
public class ConfigurationException extends Exception {
private static final long serialVersionUID = 745070392618501822L;
private final Set<Exception> fExceptions;
protected ConfigurationException(Set<Exception> exceptions) {
fExceptions = exceptions;
}
protected ConfigurationException(Exception exception) {
fExceptions = new HashSet<>();
fExceptions.add(exception);
}
@Override
public String getLocalizedMessage() {
String result = super.getLocalizedMessage();
result += "\nCaused by following exception(s):";
for (Exception e : fExceptions) {
result += "\n"+e.getClass().getCanonicalName()+" - "+e.getLocalizedMessage();
}
return result;
}
}