1 /*
2 * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> and others
4 *
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Distribution License v. 1.0 which is available at
7 * https://www.eclipse.org/org/documents/edl-v10.php.
8 *
9 * SPDX-License-Identifier: BSD-3-Clause
10 */
11
12 package org.eclipse.jgit.errors;
13
14 import org.eclipse.jgit.internal.JGitText;
15
16 /**
17 * Indicates a checked exception was thrown inside of
18 * {@link org.eclipse.jgit.revwalk.RevWalk}.
19 * <p>
20 * Usually this exception is thrown from the Iterator created around a RevWalk
21 * instance, as the Iterator API does not allow checked exceptions to be thrown
22 * from hasNext() or next(). The {@link java.lang.Exception#getCause()} of this
23 * exception is the original checked exception that we really wanted to throw
24 * back to the application for handling and recovery.
25 */
26 public class RevWalkException extends RuntimeException {
27 private static final long serialVersionUID = 1L;
28
29 /**
30 * Create a new walk exception an original cause.
31 *
32 * @param cause
33 * the checked exception that describes why the walk failed.
34 */
35 public RevWalkException(Throwable cause) {
36 super(JGitText.get().walkFailure, cause);
37 }
38 }