mirror of
https://github.com/StarBeat/JsonRpc.git
synced 2026-03-08 03:55:29 +08:00
27 lines
824 B
C#
27 lines
824 B
C#
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!;
|
||
}
|
||
}
|