#[repr(u32)]pub enum ErrorCode {
Show 64 variants
ConnectionFailed = 1_000,
ConnectionTimeout = 1_001,
ConnectionClosed = 1_002,
ConnectionRefused = 1_003,
ConnectionLimitExceeded = 1_004,
NotConnected = 1_005,
ConnectionReconnecting = 1_006,
AuthenticationFailed = 2_000,
AuthenticationExpired = 2_001,
AuthenticationInvalid = 2_002,
AuthenticationRequired = 2_003,
PermissionDenied = 2_004,
TokenInvalid = 2_005,
TokenExpired = 2_006,
ProtocolError = 3_000,
ProtocolVersionMismatch = 3_001,
ProtocolNotSupported = 3_002,
MessageFormatError = 3_003,
MessageTooLarge = 3_004,
InvalidCommand = 3_005,
MessageSendFailed = 4_000,
MessageDeliveryFailed = 4_001,
MessageNotFound = 4_002,
MessageExpired = 4_003,
MessageRateLimitExceeded = 4_004,
MessageDecodeFailed = 4_005,
UserNotFound = 5_000,
UserOffline = 5_001,
UserBlocked = 5_002,
UserQuotaExceeded = 5_003,
UserSessionLimitExceeded = 5_004,
InternalError = 6_000,
ServiceUnavailable = 6_001,
ResourceExhausted = 6_002,
ConfigurationError = 6_003,
DatabaseError = 6_004,
NetworkError = 7_000,
NetworkTimeout = 7_001,
NetworkUnreachable = 7_002,
NetworkConnectionLost = 7_003,
SerializationError = 8_000,
DeserializationError = 8_001,
EncodingError = 8_002,
GeneralError = 9_000,
InvalidParameter = 9_001,
OperationNotSupported = 9_002,
OperationFailed = 9_003,
OperationTimeout = 9_004,
BadRequest = 9_005,
SyncCursorRegression = 9_101,
UnknownError = 9_999,
HttpBadRequest = 400,
HttpUnauthorized = 401,
HttpForbidden = 403,
HttpNotFound = 404,
HttpMethodNotAllowed = 405,
HttpRequestTimeout = 408,
HttpConflict = 409,
HttpUnprocessableEntity = 422,
HttpTooManyRequests = 429,
HttpInternalServerError = 500,
HttpBadGateway = 502,
HttpServiceUnavailable = 503,
HttpGatewayTimeout = 504,
}Expand description
错误代码枚举 - 用于国际化
错误代码按类别分组,每个类别占用1000个代码范围:
- 1000-1999: 连接相关错误
- 2000-2999: 认证相关错误
- 3000-3999: 协议相关错误
- 4000-4999: 消息相关错误
- 5000-5999: 用户相关错误
- 6000-6999: 系统相关错误
- 7000-7999: 网络相关错误
- 8000-8999: 序列化相关错误
- 9000-9999: 通用错误
Variants§
ConnectionFailed = 1_000
ConnectionTimeout = 1_001
ConnectionClosed = 1_002
ConnectionRefused = 1_003
ConnectionLimitExceeded = 1_004
NotConnected = 1_005
ConnectionReconnecting = 1_006
AuthenticationFailed = 2_000
AuthenticationExpired = 2_001
AuthenticationInvalid = 2_002
AuthenticationRequired = 2_003
PermissionDenied = 2_004
TokenInvalid = 2_005
TokenExpired = 2_006
ProtocolError = 3_000
ProtocolVersionMismatch = 3_001
ProtocolNotSupported = 3_002
MessageFormatError = 3_003
MessageTooLarge = 3_004
InvalidCommand = 3_005
MessageSendFailed = 4_000
MessageDeliveryFailed = 4_001
MessageNotFound = 4_002
MessageExpired = 4_003
MessageRateLimitExceeded = 4_004
MessageDecodeFailed = 4_005
UserNotFound = 5_000
UserOffline = 5_001
UserBlocked = 5_002
UserQuotaExceeded = 5_003
UserSessionLimitExceeded = 5_004
InternalError = 6_000
ResourceExhausted = 6_002
ConfigurationError = 6_003
DatabaseError = 6_004
NetworkError = 7_000
NetworkTimeout = 7_001
NetworkUnreachable = 7_002
NetworkConnectionLost = 7_003
SerializationError = 8_000
DeserializationError = 8_001
EncodingError = 8_002
GeneralError = 9_000
InvalidParameter = 9_001
OperationNotSupported = 9_002
OperationFailed = 9_003
OperationTimeout = 9_004
BadRequest = 9_005
SyncCursorRegression = 9_101
同步游标回退或本地水位落后于服务端(客户端应重新拉快照 / 全量同步,勿重试同一请求)
UnknownError = 9_999
HttpBadRequest = 400
HTTP 400 Bad Request
HTTP 401 Unauthorized
HttpForbidden = 403
HTTP 403 Forbidden
HttpNotFound = 404
HTTP 404 Not Found
HttpMethodNotAllowed = 405
HTTP 405 Method Not Allowed
HttpRequestTimeout = 408
HTTP 408 Request Timeout
HttpConflict = 409
HTTP 409 Conflict
HttpUnprocessableEntity = 422
HTTP 422 Unprocessable Entity
HttpTooManyRequests = 429
HTTP 429 Too Many Requests
HttpInternalServerError = 500
HTTP 500 Internal Server Error
HttpBadGateway = 502
HTTP 502 Bad Gateway
HTTP 503 Service Unavailable
HttpGatewayTimeout = 504
HTTP 504 Gateway Timeout
Implementations§
Trait Implementations§
impl Copy for ErrorCode
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ErrorCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ErrorCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ErrorCode
Source§impl Serialize for ErrorCode
impl Serialize for ErrorCode
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request