aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/PatchFormatException.java
blob: ed30e01a73b1d5ba3e6e7474cc036ea110e98ee9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * Copyright (C) 2012, IBM Corporation and others. and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
package org.eclipse.jgit.api.errors;

import java.text.MessageFormat;
import java.util.List;

import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.patch.FormatError;

/**
 * Exception thrown when applying a patch fails due to an invalid format
 *
 * @since 2.0
 */
public class PatchFormatException extends GitAPIException {
	private static final long serialVersionUID = 1L;

	private List<FormatError> errors;

	/**
	 * Constructor for PatchFormatException
	 *
	 * @param errors
	 *            a {@link java.util.List} of {@link FormatError}s
	 */
	public PatchFormatException(List<FormatError> errors) {
		super(MessageFormat.format(JGitText.get().patchFormatException, errors));
		this.errors = errors;
	}

	/**
	 * Get list of errors
	 *
	 * @return all the errors where unresolved conflicts have been detected
	 */
	public List<FormatError> getErrors() {
		return errors;
	}

}