/*
 * Copyright 2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package leap.core.validation;

import leap.core.AppException;

public class ValidationException extends AppException {

	private static final long serialVersionUID = -8463407181817460250L;
	
	protected final Errors errors;

	public ValidationException(Errors errors) {
		super(errors.getMessage());
		this.errors = errors;
	}

	public ValidationException(Errors errors, String message) {
		super(message);
		this.errors = errors;
	}

	public ValidationException(Errors errors, Throwable cause) {
		super(cause);
		this.errors = errors;
	}

	public ValidationException(Errors errors, String message, Throwable cause) {
		super(message, cause);
		this.errors = errors;
	}

    public ValidationException(String message) {
        errors = new SimpleErrors();
        errors.add("ValidationError",message);
    }

    public ValidationException(String code, String message) {
        errors = new SimpleErrors();
        errors.add(code,message);
    }

	public Errors getErrors() {
		return errors;
	}

}

@@ -1321,32 +1321,56 @@
 ring message) %7B%0A
+        super(message);%0A
         errors =
@@ -1498,32 +1498,56 @@
 ring message) %7B%0A
+        super(message);%0A
         errors =

fix - no exception message in some constructors at ValidateException