aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/errors/RevisionSyntaxException.java
blob: 084d67c02bd5efc54fda68384d580dd8d39c547d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
 * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>
 * Copyright (C) 2009, Vasyl' Vavrychuk <vvavrychuk@gmail.com> 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.eclipse.jgit.errors;


/**
 * This signals a revision or object reference was not
 * properly formatted.
 */
public class RevisionSyntaxException extends IllegalArgumentException {
	private static final long serialVersionUID = 1L;

	private final String revstr;

	/**
	 * Construct a RevisionSyntaxException indicating a syntax problem with a
	 * revision (or object) string.
	 *
	 * @param revstr The problematic revision string
	 */
	public RevisionSyntaxException(String revstr) {
		this.revstr = revstr;
	}

	/**
	 * Construct a RevisionSyntaxException indicating a syntax problem with a
	 * revision (or object) string.
	 *
	 * @param message a specific reason
	 * @param revstr The problematic revision string
	 */
	public RevisionSyntaxException(String message, String revstr) {
		super(message);
		this.revstr = revstr;
	}

	/** {@inheritDoc} */
	@Override
	public String toString() {
		return super.toString() + ":" + revstr; //$NON-NLS-1$
	}
}