diff --git a/dotnet/src/webdriver/DevTools/DevToolsSession.cs b/dotnet/src/webdriver/DevTools/DevToolsSession.cs index da03bd4860dfa..d42c9568219b8 100644 --- a/dotnet/src/webdriver/DevTools/DevToolsSession.cs +++ b/dotnet/src/webdriver/DevTools/DevToolsSession.cs @@ -455,7 +455,16 @@ private void MonitorMessageQueue() // in the IEnumerable, meaning the foreach loop will terminate gracefully. foreach (string message in this.messageQueue.GetConsumingEnumerable()) { - this.ProcessMessage(message); + // Don't breake entire thread in case of unsuccessful message, + // and give a chance for the next message in queue to be processed + try + { + this.ProcessMessage(message); + } + catch(Exception ex) + { + LogError("Unexpected error occured while processing message: {0}", ex); + } } }