Skip to content

Commit ee1a005

Browse files
committed
But give a chance for commands and responses
1 parent 8ddd205 commit ee1a005

File tree

1 file changed

+12
-2
lines changed
  • dotnet/src/webdriver/BiDi/Communication

1 file changed

+12
-2
lines changed

dotnet/src/webdriver/BiDi/Communication/Broker.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,24 @@ private async Task ReceiveMessagesAsync(CancellationToken cancellationToken)
129129
{
130130
var data = await _transport.ReceiveAsync(cancellationToken).ConfigureAwait(false);
131131

132-
ProcessReceivedMessage(data);
132+
try
133+
{
134+
ProcessReceivedMessage(data);
135+
}
136+
catch (Exception ex)
137+
{
138+
if (_logger.IsEnabled(LogEventLevel.Error))
139+
{
140+
_logger.Error($"Unhandled error occured while process remote message: {ex}");
141+
}
142+
}
133143
}
134144
}
135145
catch (Exception ex) when (ex is not OperationCanceledException)
136146
{
137147
if (_logger.IsEnabled(LogEventLevel.Error))
138148
{
139-
_logger.Error($"Couldn't receive or process BiDi remote message: {ex}");
149+
_logger.Error($"Unhandled error occured while receiving remote messages: {ex}");
140150
}
141151

142152
throw;

0 commit comments

Comments
 (0)