All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openrewrite.jgit.transport.WantNotValidException Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2016, Google Inc. 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.openrewrite.jgit.transport;

import java.text.MessageFormat;

import org.openrewrite.jgit.errors.PackProtocolException;
import org.openrewrite.jgit.internal.JGitText;
import org.openrewrite.jgit.lib.AnyObjectId;

/**
 * Indicates client requested an object the server does not want to serve.
 * 

* Typically visible only inside of the server implementation; clients are * usually looking at the text message from the server in a generic * {@link org.openrewrite.jgit.errors.PackProtocolException}. * * @since 4.3 */ public class WantNotValidException extends PackProtocolException { private static final long serialVersionUID = 1L; /** * Construct a {@code "want $id not valid"} exception. * * @param id * invalid object identifier received from the client. */ public WantNotValidException(AnyObjectId id) { super(msg(id)); } /** * Construct a {@code "want $id not valid"} exception. * * @param id * invalid object identifier received from the client. * @param cause * root cause of the object being invalid, such as an IOException * from the storage system. */ public WantNotValidException(AnyObjectId id, Throwable cause) { super(msg(id), cause); } private static String msg(AnyObjectId id) { return MessageFormat.format(JGitText.get().wantNotValid, id.name()); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy