View Javadoc
1   /*
2    * Copyright (C) 2021, Fabio Ponciroli <ponch@gerritforge.com>
3    *
4    * This program and the accompanying materials are made available under the
5    * terms of the Eclipse Distribution License v. 1.0 which is available at
6    * https://www.eclipse.org/org/documents/edl-v10.php.
7    *
8    * SPDX-License-Identifier: BSD-3-Clause
9    */
10  
11  package org.eclipse.jgit.errors;
12  
13  import org.eclipse.jgit.internal.JGitText;
14  
15  import java.io.IOException;
16  import java.text.MessageFormat;
17  import java.time.Duration;
18  
19  /**
20   * Thrown when the search for reuse phase times out.
21   *
22   * @since 5.13
23   */
24  public class SearchForReuseTimeout extends IOException {
25  	private static final long serialVersionUID = 1L;
26  
27  	/**
28  	 * Construct a search for reuse timeout error.
29  	 *
30  	 * @param timeout
31  	 *            time exceeded during the search for reuse phase.
32  	 */
33  	public SearchForReuseTimeout(Duration timeout) {
34  		super(MessageFormat.format(JGitText.get().searchForReuseTimeout,
35  				Long.valueOf(timeout.getSeconds())));
36  	}
37  
38  	@Override
39  	public synchronized Throwable fillInStackTrace() {
40  		return this;
41  	}
42  }