Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions dotnet/src/webdriver/WebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ protected WebDriver(ICommandExecutor executor, ICapabilities capabilities)
}
catch (Exception)
{
// Failed to start driver session, disposing of driver
this.Quit();
try
{
// Failed to start driver session, disposing of driver
this.Quit();
}
catch
{
// Ignore the clean-up exception. We'll propagate the original failure.
}
throw;
}

Expand Down Expand Up @@ -703,7 +710,10 @@ protected virtual void Dispose(bool disposing)
{
try
{
this.Execute(DriverCommand.Quit, null);
if (this.sessionId is not null)
{
this.Execute(DriverCommand.Quit, null);
}
}
catch (NotImplementedException)
{
Expand Down