PackProtocolException.java

  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. package org.eclipse.jgit.errors;

  13. import org.eclipse.jgit.transport.URIish;

  14. /**
  15.  * Indicates a protocol error has occurred while fetching/pushing objects.
  16.  */
  17. public class PackProtocolException extends TransportException {
  18.     private static final long serialVersionUID = 1L;

  19.     /**
  20.      * Constructs an PackProtocolException with the specified detail message
  21.      * prefixed with provided URI.
  22.      *
  23.      * @param uri
  24.      *            URI used for transport
  25.      * @param s
  26.      *            message, which may be shown to an end-user.
  27.      */
  28.     public PackProtocolException(URIish uri, String s) {
  29.         super(uri + ": " + s); //$NON-NLS-1$
  30.     }

  31.     /**
  32.      * Constructs an PackProtocolException with the specified detail message
  33.      * prefixed with provided URI.
  34.      *
  35.      * @param uri
  36.      *            URI used for transport
  37.      * @param s
  38.      *            message, which may be shown to an end-user.
  39.      * @param cause
  40.      *            root cause exception
  41.      */
  42.     public PackProtocolException(final URIish uri, final String s,
  43.             final Throwable cause) {
  44.         this(uri + ": " + s, cause); //$NON-NLS-1$
  45.     }

  46.     /**
  47.      * Constructs an PackProtocolException with the specified detail message.
  48.      *
  49.      * @param s
  50.      *            message, which may be shown to an end-user.
  51.      */
  52.     public PackProtocolException(String s) {
  53.         super(s);
  54.     }

  55.     /**
  56.      * Constructs an PackProtocolException with the specified detail message.
  57.      *
  58.      * @param s
  59.      *            message, which may be shown to an end-user.
  60.      * @param cause
  61.      *            root cause exception
  62.      */
  63.     public PackProtocolException(String s, Throwable cause) {
  64.         super(s);
  65.         initCause(cause);
  66.     }
  67. }