package com.evolveum.midpoint.util;

import com.evolveum.midpoint.util.result.OperationResult;

/**
 * This class is used as base class for exceptions which are thrown in complex
 * operations. It provides @{link OperationResult} object for better error
 * handling.
 * 
 * @author lazyman
 * 
 */
public abstract class MidPointException extends Exception {

	private static final long serialVersionUID = -1203865058138765240L;
	private OperationResult result;

	public MidPointException(String message, OperationResult result) {
		this(message, null, result);
	}

	public MidPointException(String message, Throwable ex, OperationResult result) {
		super(message, ex);
		if (result == null) {
			throw new IllegalArgumentException("Operation result must not be null.");
		}
		this.result = result;
	}

	public OperationResult getResult() {
		return result;
	}
}

@@ -1,8 +1,748 @@
+/*%0A * Copyright (c) 2011 Evolveum%0A *%0A * The contents of this file are subject to the terms%0A * of the Common Development and Distribution License%0A * (the License). You may not use this file except in%0A * compliance with the License.%0A *%0A * You can obtain a copy of the License at%0A * http://www.opensource.org/licenses/cddl1 or%0A * CDDLv1.0.txt file in the source code distribution.%0A * See the License for the specific language governing%0A * permission and limitations under the License.%0A *%0A * If applicable, add the following below the CDDL Header,%0A * with the fields enclosed by brackets %5B%5D replaced by%0A * your own identifying information:%0A *%0A * Portions Copyrighted 2011 %5Bname of copyright owner%5D%0A * Portions Copyrighted 2011 Viliam Repan%0A */%0A
 package 

Add missing copyright