Skip to main content

Crate rocketmq_error

Crate rocketmq_error 

Source
Expand description

§RocketMQ Error Handling

This crate provides the canonical catalog, opaque Error envelope, typed context, safe views, and boundary-neutral policy used by RocketMQ components.

Catalog descriptors are the sole owners of stable identity and policy. Error instances retain one direct typed source and record the first caller that promotes a failure into the canonical envelope. Formatting and safe views never render source text, caller paths, or backtrace frames.

use std::io;
use rocketmq_error::{Error, Result, RUNTIME_IO_FAILED};

fn read_metadata() -> Result<()> {
    Err(Error::caused_by(
        &RUNTIME_IO_FAILED,
        io::Error::other("metadata read failed"),
    ))
}

let error = read_metadata().expect_err("example failure");
assert_eq!(error.code().as_str(), "runtime.io.failed");

Modules§

fields
Catalog-owned context field keys.

Structs§

BoolField
Marker for Boolean fields.
CliErrorView
Stable error view for command-line tools.
CliExitCode
CLI exit-code primitive.
CliOutput
Complete process-boundary projection for one CLI failure.
CliSpec
Represents cli spec.
ComponentId
Catalog owner for a canonical descriptor.
DiagnosticFields
A borrowed descriptor-ordered iterator over controlled diagnostic fields.
DiagnosticView
A borrowed controlled-diagnostics projection of one descriptor-validated context.
Error
Opaque canonical RocketMQ error.
ErrorClass
Broad classification used for stable diagnostic policy.
ErrorCode
Stable machine-readable error code.
ErrorContext
Redaction-aware structured context for errors.
ErrorContextField
One immutable structured error context field.
ErrorDescriptor
Immutable catalog metadata for one canonical error identity.
FieldKey
Opaque catalog key for a context field of marker type T.
FieldSchema
Immutable schema for one catalog-owned context field.
FilterCompileError
A redaction-safe SQL filter compilation error.
GrpcSpec
Represents grpc spec.
HttpSpec
Represents http spec.
HttpStatusCode
HTTP status-code primitive.
I64Field
Marker for signed integer fields.
ProjectionSpec
Explicit boundary projections owned by an error descriptor.
PublicErrorView
A borrowed public projection of one descriptor-validated error context.
PublicFields
A borrowed descriptor-ordered iterator over public context fields.
RemotingSpec
Represents remoting spec.
SecretPresenceField
Marker for value-free secret-presence fields.
Sensitive
Wrapper for values that must never be formatted directly.
TextField
Marker for bounded text fields.
U64Field
Marker for unsigned integer fields.
ViewFieldRef
A borrowed field exposed by a descriptor-validated view.

Enums§

BacktracePolicy
Catalog-controlled backtrace capture policy.
CanonicalCondition
Protocol-independent condition assigned by a canonical error descriptor.
CliVerbosity
Controls how much safe diagnostic information a CLI error line contains.
ContextVisibility
Controls which error projections may observe a context field.
ErrorSeverity
Default severity for logs, metrics, traces, and alert routing.
Exposure
Public-context exposure policy for a descriptor.
FaultAttribution
Party or resource attributed with a canonical failure.
FieldValueKind
Closed vocabulary of values supported by structured error context.
FieldValueRef
Borrowed value of a structured context field.
FilterCompileErrorKind
The category of a SQL filter compilation failure.
FilterCompileSource
A fixed, redaction-safe source classification for filter compilation.
FilterCompileStage
The SQL compilation stage at which a filter failure occurred.
GrpcPayloadCode
gRPC payload-code primitive.
GrpcStatusCode
Transport-level gRPC status primitive.
RecoveryHint
Catalog-owned recovery advice for a canonical error descriptor.
RemotingResponseCode
Remoting response-code primitive.
ViewContextViolation
A descriptor/context contract violation discovered while creating a safe view.
ViewValueRef
A safe borrowed value exposed by a descriptor-validated view.

Constants§

ALL_DESCRIPTORS
Every canonical descriptor currently declared by rocketmq-error.
AUTH_CONFIGURATION_INVALID
Invalid authentication configuration.
AUTH_CONFIGURATION_RELOAD_FAILED
Authentication configuration reload failed.
AUTH_CREDENTIALS_INVALID
Invalid authentication credentials or signature.
AUTH_OPERATION_FAILED
Authentication operation failed independently of credential validity.
AUTH_PERMISSION_DENIED
Permission denied for an authenticated principal.
AUTH_USER_NOT_FOUND
Requested authentication user does not exist.
BROKER_LEADERSHIP_NOT_MASTER
Broker is not the current master for the operation.
BROKER_LOOKUP_NOT_FOUND
Broker lookup did not find a matching broker.
BROKER_MESSAGE_INVALID
Message validation failed at the broker boundary.
BROKER_MESSAGE_TOO_LARGE
Message body exceeds the broker’s configured size limit.
BROKER_OPERATION_FAILED
Broker operation failed with an internal remote response.
BROKER_QUERY_NOT_FOUND
Broker query did not find the requested result.
BROKER_QUEUE_ID_OUT_OF_RANGE
Queue identifier is outside the broker’s configured range.
BROKER_QUEUE_NOT_FOUND
Queue does not exist at the broker.
BROKER_REGISTRATION_FAILED
Broker registration operation failed.
BROKER_SUBSCRIPTION_GROUP_NOT_FOUND
Subscription group does not exist at the broker.
BROKER_TASK_FAILED
Broker asynchronous task failed.
BROKER_TOPIC_NOT_FOUND
Topic does not exist at the broker.
BROKER_TRANSACTION_REJECTED
Transaction message was rejected by the broker.
CLIENT_COMPONENT_UNAVAILABLE
Required client component is unavailable.
CLIENT_LIFECYCLE_ALREADY_STARTED
Client startup requested after the client was already started.
CLIENT_LIFECYCLE_INVALID_STATE
Client lifecycle state does not permit the operation.
CLIENT_LIFECYCLE_NOT_STARTED
Client operation attempted before startup completed.
CLIENT_LIFECYCLE_SHUTTING_DOWN
Client is shutting down and cannot accept the operation.
CLIENT_RETRY_BUDGET_EXHAUSTED
Client retry budget was exhausted.
CONTROLLER_CONFIGURATION_INVALID
Invalid controller configuration.
CONTROLLER_CONSENSUS_FAILED
Controller consensus operation failed.
CONTROLLER_CONSENSUS_TIMED_OUT
Controller consensus operation exceeded its deadline.
CONTROLLER_INTERNAL_FAILURE
Internal controller operation failed.
CONTROLLER_LEADERSHIP_NOT_LEADER
Operation sent to a controller that is not the leader.
CONTROLLER_LIFECYCLE_NOT_INITIALIZED
Controller operation attempted before initialization completed.
CONTROLLER_REQUEST_INVALID
Invalid controller request.
CORE_ARGUMENT_INVALID
Invalid argument supplied to a core operation.
CORE_CONFIGURATION_INVALID
Configuration value is invalid.
CORE_CONFIGURATION_MISSING
Required configuration is missing.
CORE_CONFIGURATION_PARSE_FAILED
Configuration parsing failed.
CORE_INTERNAL_FAILURE
Internal failure without a more specific catalog identity.
CORE_IO_FAILED
Input/output operation failed.
CORE_LIFECYCLE_NOT_INITIALIZED
Component operation attempted before initialization completed.
CORE_OPERATION_TIMED_OUT
Core operation exceeded its deadline.
CORE_SERIALIZATION_FAILED
Serialization or deserialization operation failed.
CORE_SERVICE_FAILED
Service lifecycle operation failed.
OBSERVABILITY_CONFIGURATION_INVALID
Observability configuration is invalid.
OBSERVABILITY_FEATURE_DISABLED
A requested observability feature is disabled.
OBSERVABILITY_INITIALIZATION_FAILED
Observability initialization failed.
OBSERVABILITY_LOG_FILTER_INVALID
The configured observability log filter is invalid.
OBSERVABILITY_SHUTDOWN_FAILED
Observability shutdown failed.
OBSERVABILITY_SUBSCRIBER_INSTALLATION_FAILED
Global observability subscriber installation failed.
PROTOCOL_BODY_INVALID
Invalid request-body syntax or values.
PROTOCOL_ENCODING_UNSUPPORTED
Unsupported protocol encoding selection.
PROTOCOL_FILTER_INVALID
Filter validation or compilation failed.
PROTOCOL_HEADER_INVALID
Invalid request-header syntax or values.
PROTOCOL_MESSAGE_PROPERTY_INVALID
Invalid message property supplied to the protocol layer.
PROTOCOL_REQUEST_UNSUPPORTED
Unsupported RocketMQ request code.
PROTOCOL_RESPONSE_FAILED
Invalid response received from a remote peer.
PROTOCOL_VERSION_UNSUPPORTED
Protocol version that this implementation does not support.
PROXY_BROKER_CONSUMER_GROUP_NOT_FOUND
A Broker reported that a consumer group requested through the Proxy was absent.
PROXY_BROKER_OFFSET_INVALID
A Broker rejected an invalid offset supplied through the Proxy.
PROXY_BROKER_OFFSET_NOT_FOUND
A Broker reported that an offset requested through the Proxy was absent.
PROXY_BROKER_PERMISSION_DENIED
A Broker denied an operation issued through the Proxy.
PROXY_BROKER_REQUEST_UNSUPPORTED
A Broker does not implement a request issued through the Proxy.
PROXY_BROKER_RESOURCE_NOT_FOUND
A Broker reported that a generic resource requested through the Proxy was absent.
PROXY_BROKER_RESPONSE_FAILED
A Broker returned a failure that has no more specific Proxy classification.
PROXY_BROKER_TOPIC_NOT_FOUND
A Broker reported that a topic requested through the Proxy was absent.
PROXY_CAPABILITY_UNSUPPORTED
A requested Proxy capability is not implemented.
PROXY_CAPACITY_EXHAUSTED
A Proxy-local capacity limit rejected a request.
PROXY_CLIENT_ID_REQUIRED
A Proxy gRPC request omitted its required client identifier.
PROXY_CLIENT_TYPE_UNRECOGNIZED
A Proxy gRPC request declared an unrecognized client type.
PROXY_DELIVERY_TIME_INVALID
A Proxy request supplied an invalid delivery time.
PROXY_DRAIN_UNAVAILABLE
Proxy drain lifecycle or readiness state is unavailable.
PROXY_FILTER_EXPRESSION_INVALID
A Proxy request supplied an invalid filter expression.
PROXY_INVISIBLE_TIME_INVALID
A Proxy request supplied an invalid invisible time.
PROXY_LITE_SUBSCRIPTION_QUOTA_EXCEEDED
A Proxy lite-subscription quota was exhausted.
PROXY_LITE_TOPIC_INVALID
A Proxy request supplied an invalid lite topic.
PROXY_MESSAGE_GROUP_INVALID
A Proxy request supplied an invalid message group.
PROXY_MESSAGE_ID_INVALID
A Proxy request supplied an invalid message identifier.
PROXY_MESSAGE_PROPERTY_CONFLICT
A Proxy request supplied a message property that conflicts with its message type.
PROXY_METADATA_INVALID
A Proxy gRPC request supplied invalid metadata.
PROXY_OFFSET_INVALID
A Proxy request supplied an invalid offset.
PROXY_POLLING_TIME_INVALID
A Proxy request supplied an invalid polling time.
PROXY_RECEIPT_HANDLE_INVALID
A Proxy request supplied an invalid receipt handle.
PROXY_REMOTING_REQUEST_INVALID
A remoting request could not be decoded or validated by the Proxy.
PROXY_REQUEST_DRAINING
A draining Proxy rejected a new request.
PROXY_SETTINGS_UNAVAILABLE
Authoritative Proxy client settings are unavailable.
PROXY_TRANSACTION_ID_INVALID
A Proxy request supplied an invalid transaction identifier.
PROXY_TRANSPORT_UNAVAILABLE
A Proxy transport dependency is unavailable.
PROXY_UPSTREAM_REQUEST_FAILED
An upstream request issued by the Proxy failed.
REDACTED
The redacted constant.
ROUTE_CLUSTER_NOT_FOUND
Route lookup did not find the requested cluster.
ROUTE_REGISTRATION_CONFLICT
Route registration could not complete because of conflicting state.
ROUTE_TOPIC_INCONSISTENT
Topic route information is internally inconsistent.
ROUTE_TOPIC_NOT_FOUND
Missing routing information for a topic.
RPC_BROKER_ADDRESS_NOT_FOUND
RPC client metadata did not contain a broker address.
RPC_REQUEST_FAILED
RPC request construction or invocation failed.
RPC_REQUEST_UNSUPPORTED
RPC client does not support the requested operation.
RPC_RESPONSE_FAILED
RPC response status or payload indicated failure.
RUNTIME_BUILD_FAILED
Runtime construction failed.
RUNTIME_CAPACITY_EXHAUSTED
Runtime capacity needed by an operational path is exhausted.
RUNTIME_CONFIGURATION_FAILED
Runtime configuration could not be loaded or interpreted.
RUNTIME_CONTEXT_UNAVAILABLE
A required Tokio runtime context is unavailable.
RUNTIME_INTERNAL_FAILURE
An internal runtime failure occurred.
RUNTIME_IO_FAILED
Runtime I/O failed.
RUNTIME_OPERATION_TIMED_OUT
A runtime operation exceeded its deadline.
RUNTIME_OPERATION_UNSUPPORTED
A runtime operation is unsupported.
RUNTIME_TASK_JOIN_FAILED
A runtime task could not be joined.
SECURITY_PROVIDER_CONFLICT
Security-provider state conflicts with the requested update.
SECURITY_PROVIDER_CONTRACT_VIOLATION
A deterministic security-provider contract was violated.
SECURITY_PROVIDER_INVALID_DATA
Security-provider data is malformed, corrupted, or cannot be authenticated.
SECURITY_PROVIDER_NOT_FOUND
Requested security-provider material does not exist.
SECURITY_PROVIDER_OPERATION_FAILED
A security-provider operation failed for an internal reason.
SECURITY_PROVIDER_UNAVAILABLE
The security provider or a required dependency is unavailable.
SECURITY_PROVIDER_UNSUPPORTED
The requested security-provider capability is unsupported.
STORAGE_BACKEND_UNAVAILABLE
Configured storage backend is unavailable.
STORAGE_CAPACITY_EXHAUSTED
Storage has no remaining capacity for the operation.
STORAGE_INTERNAL_FAILURE
Internal storage failure without a more specific descriptor.
STORAGE_IO_FAILED
Storage I/O operation failed.
STORAGE_LIFECYCLE_NOT_STARTED
Storage lifecycle operation attempted before startup completed.
STORAGE_MAPPED_FILE_NOT_FOUND
Requested mapped file does not exist.
STORAGE_OPERATION_TIMED_OUT
Storage operation exceeded its deadline.
STORAGE_OPERATION_UNSUPPORTED
Storage operation is not implemented by the backend.
STORAGE_READ_FAILED
Storage read operation failed.
STORAGE_REQUEST_INVALID
Invalid request at the storage capability boundary.
STORAGE_STATE_CORRUPTED
Storage state is corrupted.
STORAGE_WRITE_FAILED
Storage write operation failed.
TOOLS_OPERATION_FAILED
An administrative tool operation failed.
TRANSPORT_ADMISSION_QUEUE_SATURATED
Saturated transport admission queue.
TRANSPORT_CONNECTION_FAILED
Transport connection operation failed.
TRANSPORT_CONNECTION_TIMEOUT
Timed-out transport connection attempt.
TRANSPORT_DISPATCH_FAILED
Transport request dispatch failed.
TRANSPORT_DNS_FAILED
DNS resolution for a transport endpoint failed.
TRANSPORT_ENDPOINT_INVALID
Invalid transport endpoint syntax.
TRANSPORT_REMOTE_RATE_LIMITED
Remote transport peer rejected work because of capacity limits.
TRANSPORT_RESPONSE_FAILED
Transport response delivery failed.
TRANSPORT_RESPONSE_TIMEOUT
Transport response did not arrive before its deadline.
TRANSPORT_SESSION_FAILED
Transport session operation failed.
TRANSPORT_START_FAILED
Transport server startup failed.
TRANSPORT_WRITE_TIMEOUT
Transport write exceeded its deadline.

Functions§

descriptor_by_code
Returns the registered descriptor for code.

Type Aliases§

Result
Result whose error is the canonical Error.
SharedError
Shared ownership of one canonical Error instance.