mirror of
https://github.com/microsoft/playwright-java.git
synced 2025-12-29 02:40:42 +00:00
fix: remove Exception from Playwright.close signature (#240)
This commit is contained in:
parent
2c6e278167
commit
65df7be823
@ -50,6 +50,6 @@ public interface Playwright {
|
||||
return PlaywrightImpl.create();
|
||||
}
|
||||
|
||||
void close() throws Exception;
|
||||
void close();
|
||||
}
|
||||
|
||||
|
||||
@ -100,12 +100,19 @@ public class PlaywrightImpl extends ChannelOwner implements Playwright {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
connection.close();
|
||||
// playwright-cli will exit when its stdin is closed, we wait for that.
|
||||
boolean didClose = driverProcess.waitFor(30, TimeUnit.SECONDS);
|
||||
if (!didClose) {
|
||||
System.err.println("WARNING: Timed out while waiting for driver process to exit");
|
||||
public void close() {
|
||||
try {
|
||||
connection.close();
|
||||
// playwright-cli will exit when its stdin is closed, we wait for that.
|
||||
boolean didClose = driverProcess.waitFor(30, TimeUnit.SECONDS);
|
||||
if (!didClose) {
|
||||
System.err.println("WARNING: Timed out while waiting for driver process to exit");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new PlaywrightException("Failed to terminate", e);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new PlaywrightException("Operation interrupted", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1089,7 +1089,7 @@ class Interface extends TypeDefinition {
|
||||
output.add(offset + " return PlaywrightImpl.create();");
|
||||
output.add(offset + "}");
|
||||
output.add("");
|
||||
output.add(offset + "void close() throws Exception;");
|
||||
output.add(offset + "void close();");
|
||||
}
|
||||
output.add("}");
|
||||
output.add("\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user