Skip to content

Commit c277050

Browse files
committed
Java: Introducing NoSuchSessionException in the core API
1 parent 1671840 commit c277050

5 files changed

Lines changed: 48 additions & 3 deletions

File tree

java/client/src/org/openqa/selenium/BUCK

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ java_library(name = 'exceptions',
8585
'NoAlertPresentException.java',
8686
'NoSuchElementException.java',
8787
'NoSuchFrameException.java',
88+
'NoSuchSessionException.java',
8889
'NoSuchWindowException.java',
8990
'NotFoundException.java',
9091
'SessionNotCreatedException.java',
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Licensed to the Software Freedom Conservancy (SFC) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The SFC licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package org.openqa.selenium;
19+
20+
/**
21+
* Thrown by any command being called after {@link WebDriver#quit() WebDriver.quit()}.
22+
*/
23+
public class NoSuchSessionException extends NotFoundException {
24+
25+
public NoSuchSessionException() {
26+
}
27+
28+
public NoSuchSessionException(String reason) {
29+
super(reason);
30+
}
31+
32+
public NoSuchSessionException(String reason, Throwable cause) {
33+
super(reason, cause);
34+
}
35+
36+
}

java/client/src/org/openqa/selenium/build.desc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ java_library(name = "webdriver-api",
4444
"NoAlertPresentException.java",
4545
"NoSuchElementException.java",
4646
"NoSuchFrameException.java",
47+
"NoSuchSessionException.java",
4748
"NoSuchWindowException.java",
4849
"NotFoundException.java",
4950
"OutputType.java",

java/client/src/org/openqa/selenium/remote/SessionNotFoundException.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@
1616
// under the License.
1717
package org.openqa.selenium.remote;
1818

19-
import org.openqa.selenium.WebDriverException;
19+
import org.openqa.selenium.NoSuchSessionException;
2020

2121
/**
2222
* Indicates that the session is not found (either terminated or not started).
23+
*
24+
* @deprecated Use {@link NoSuchSessionException NoSuchSessionException} instead
2325
*/
24-
public class SessionNotFoundException extends WebDriverException {
26+
@Deprecated
27+
public class SessionNotFoundException extends NoSuchSessionException {
2528

2629
public SessionNotFoundException() {
2730
super();
@@ -31,4 +34,8 @@ public SessionNotFoundException(String message) {
3134
super(message);
3235
}
3336

37+
public SessionNotFoundException(String message, Throwable cause) {
38+
super(message, cause);
39+
}
40+
3441
}

maven/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<role>Committer</role>
9898
</roles>
9999
</developer>
100-
<!-- A complete list can be found here: http://code.google.com/p/selenium/people/list -->
100+
<!-- A complete list can be found here: https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS -->
101101
</developers>
102102

103103
<profiles>

0 commit comments

Comments
 (0)