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 java.io.IOException; 16 17 import org.eclipse.jgit.transport.URIish; 18 19 /** 20 * Indicates a protocol error has occurred while fetching/pushing objects. 21 */ 22 public class TransportException extends IOException { 23 private static final long serialVersionUID = 1L; 24 25 /** 26 * Constructs an TransportException with the specified detail message 27 * prefixed with provided URI. 28 * 29 * @param uri 30 * URI used for transport 31 * @param s 32 * message 33 */ 34 public TransportException(URIish uri, String s) { 35 super(uri.setPass(null) + ": " + s); //$NON-NLS-1$ 36 } 37 38 /** 39 * Constructs an TransportException with the specified detail message 40 * prefixed with provided URI. 41 * 42 * @param uri 43 * URI used for transport 44 * @param s 45 * message 46 * @param cause 47 * root cause exception 48 */ 49 public TransportException(final URIish uri, final String s, 50 final Throwable cause) { 51 this(uri.setPass(null) + ": " + s, cause); //$NON-NLS-1$ 52 } 53 54 /** 55 * Constructs an TransportException with the specified detail message. 56 * 57 * @param s 58 * message 59 */ 60 public TransportException(String s) { 61 super(s); 62 } 63 64 /** 65 * Constructs an TransportException with the specified detail message. 66 * 67 * @param s 68 * message 69 * @param cause 70 * root cause exception 71 */ 72 public TransportException(String s, Throwable cause) { 73 super(s); 74 initCause(cause); 75 } 76 }