1 /*
2 * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
3 * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
4 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> and others
5 *
6 * This program and the accompanying materials are made available under the
7 * terms of the Eclipse Distribution License v. 1.0 which is available at
8 * https://www.eclipse.org/org/documents/edl-v10.php.
9 *
10 * SPDX-License-Identifier: BSD-3-Clause
11 */
12
13 package org.eclipse.jgit.errors;
14
15 import org.eclipse.jgit.transport.URIish;
16
17 /**
18 * Indicates a protocol error has occurred while fetching/pushing objects.
19 */
20 public class PackProtocolException extends TransportException {
21 private static final long serialVersionUID = 1L;
22
23 /**
24 * Constructs an PackProtocolException with the specified detail message
25 * prefixed with provided URI.
26 *
27 * @param uri
28 * URI used for transport
29 * @param s
30 * message, which may be shown to an end-user.
31 */
32 public PackProtocolException(URIish uri, String s) {
33 super(uri + ": " + s); //$NON-NLS-1$
34 }
35
36 /**
37 * Constructs an PackProtocolException with the specified detail message
38 * prefixed with provided URI.
39 *
40 * @param uri
41 * URI used for transport
42 * @param s
43 * message, which may be shown to an end-user.
44 * @param cause
45 * root cause exception
46 */
47 public PackProtocolException(final URIish uri, final String s,
48 final Throwable cause) {
49 this(uri + ": " + s, cause); //$NON-NLS-1$
50 }
51
52 /**
53 * Constructs an PackProtocolException with the specified detail message.
54 *
55 * @param s
56 * message, which may be shown to an end-user.
57 */
58 public PackProtocolException(String s) {
59 super(s);
60 }
61
62 /**
63 * Constructs an PackProtocolException with the specified detail message.
64 *
65 * @param s
66 * message, which may be shown to an end-user.
67 * @param cause
68 * root cause exception
69 */
70 public PackProtocolException(String s, Throwable cause) {
71 super(s);
72 initCause(cause);
73 }
74 }