Skip to content

Commit adcffc6

Browse files
Copilotstephentoub
andcommitted
Address PR feedback: improve catch syntax and fix XML doc
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 580743d commit adcffc6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ModelContextProtocol.Core/McpSessionHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ ex is OperationCanceledException &&
211211
{
212212
await SendMessageAsync(errorMessage, cancellationToken).ConfigureAwait(false);
213213
}
214-
catch (Exception sendException) when ((sendException is JsonException || sendException is NotSupportedException) && detail.Data is not null)
214+
catch (Exception sendException) when (sendException is JsonException or NotSupportedException && detail.Data is not null)
215215
{
216216
// If serialization fails (e.g., non-serializable data in Exception.Data),
217217
// retry without the data to ensure the client receives an error response.
@@ -781,7 +781,7 @@ private static TimeSpan GetElapsed(long startingTimestamp) =>
781781
}
782782

783783
/// <summary>
784-
/// Converts the Exception.Data dictionary to a serializable Dictionary&lt;string, object?&gt;.
784+
/// Converts the <see cref="Exception.Data"/> dictionary to a serializable <see cref="Dictionary{TKey, TValue}"/>.
785785
/// Returns null if the data dictionary is empty or contains no string keys.
786786
/// </summary>
787787
/// <remarks>

0 commit comments

Comments
 (0)