1 /*
2 * Copyright (C) 2012, IBM Corporation and others. and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0 which is available at
6 * https://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10 package org.eclipse.jgit.api.errors;
11
12 import java.text.MessageFormat;
13 import java.util.List;
14
15 import org.eclipse.jgit.internal.JGitText;
16 import org.eclipse.jgit.patch.FormatError;
17
18 /**
19 * Exception thrown when applying a patch fails due to an invalid format
20 *
21 * @since 2.0
22 */
23 public class PatchFormatException extends GitAPIException {
24 private static final long serialVersionUID = 1L;
25
26 private List<FormatError> errors;
27
28 /**
29 * Constructor for PatchFormatException
30 *
31 * @param errors
32 * a {@link java.util.List} of {@link FormatError}s
33 */
34 public PatchFormatException(List<FormatError> errors) {
35 super(MessageFormat.format(JGitText.get().patchFormatException, errors));
36 this.errors = errors;
37 }
38
39 /**
40 * Get list of errors
41 *
42 * @return all the errors where unresolved conflicts have been detected
43 */
44 public List<FormatError> getErrors() {
45 return errors;
46 }
47
48 }