Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 83846ab8a42a96c156b7a5d184c9d2422a6c8e21 (plain) (blame)
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
/******************************************************************************
 *  Copyright (c) 2011 GitHub Inc.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *    Kevin Sawicki (GitHub Inc.) - initial API and implementation
 *****************************************************************************/
package org.eclipse.egit.github.core.client;

import java.io.IOException;
import java.util.NoSuchElementException;

/**
 * Exception class to be thrown when iterating over pages fails. This exception
 * wraps an {@link IOException} that is the actual exception that occurred when
 * the page request was made.
 */
public class NoSuchPageException extends NoSuchElementException {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 6795637952359586293L;

	/**
	 * Cause exception
	 */
	protected final IOException cause;

	/**
	 * Create no such page exception
	 *
	 * @param cause
	 */
	public NoSuchPageException(IOException cause) {
		this.cause = cause;
	}

	@Override
	public String getMessage() {
		return cause != null ? cause.getMessage() : super.getMessage();
	}

	@Override
	public IOException getCause() {
		return cause;
	}
}

Back to the top