Skip to content

Commit

Permalink
[dotnet] Don't break devtools processing events thread in case of une…
Browse files Browse the repository at this point in the history
…xpected exception (#12820)

Don't break devtools processing events thread in case of unexpected exception
  • Loading branch information
nvborisenko committed Sep 26, 2023
1 parent dad73f7 commit 313ac20
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dotnet/src/webdriver/DevTools/DevToolsSession.cs
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 313ac20

Please sign in to comment.