forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsonRpcError.cs
More file actions
27 lines (25 loc) · 1 KB
/
JsonRpcError.cs
File metadata and controls
27 lines (25 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents an error response message in the JSON-RPC protocol.
/// </summary>
/// <remarks>
/// <para>
/// Error responses are sent when a request cannot be fulfilled or encounters an error during processing.
/// Like successful responses, error messages include the same ID as the original request, allowing the
/// sender to match errors with their corresponding requests.
/// </para>
/// <para>
/// Each error response contains a structured error detail object with a numeric code, descriptive message,
/// and optional additional data to provide more context about the error.
/// </para>
/// </remarks>
public class JsonRpcError : JsonRpcMessageWithId
{
/// <summary>
/// Gets detailed error information for the failed request, containing an error code,
/// message, and optional additional data
/// </summary>
[JsonPropertyName("error")]
public required JsonRpcErrorDetail Error { get; init; }
}