JsonRpc/JsonRPC/Protocol/JsonRPCError.cs
2025-10-14 21:05:08 +08:00

27 lines
824 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Text.Json.Serialization;
namespace JsonRPC.Protocol
{
public enum EErrorCode
{
ParseError = -32700,// 解析错误,服务器收到无效的 JSON。
InvalidRequest = -32600, // 无效请求,发送的 JSON 不是有效的请求对象。
MethodNotFound = -32601, // 方法未找到,方法不存在或无效。
InvalidParam = -32602, // 无效参数,提供的参数无效。
InternalError = -32603, // 内部错误JSON-RPC 内部错误。
}
[Serializable]
public class JsonRPCError
{
[JsonPropertyName("data")]
public string? Data { get; set; }
[JsonPropertyName("code")]
public int Code { get; set; }
[JsonPropertyName("message")]
public string Message { get; set; } = null!;
}
}