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§
- Bool
Field - Marker for Boolean fields.
- CliError
View - Stable error view for command-line tools.
- CliExit
Code - CLI exit-code primitive.
- CliOutput
- Complete process-boundary projection for one CLI failure.
- CliSpec
- Represents cli spec.
- Component
Id - Catalog owner for a canonical descriptor.
- Diagnostic
Fields - A borrowed descriptor-ordered iterator over controlled diagnostic fields.
- Diagnostic
View - A borrowed controlled-diagnostics projection of one descriptor-validated context.
- Error
- Opaque canonical RocketMQ error.
- Error
Class - Broad classification used for stable diagnostic policy.
- Error
Code - Stable machine-readable error code.
- Error
Context - Redaction-aware structured context for errors.
- Error
Context Field - One immutable structured error context field.
- Error
Descriptor - Immutable catalog metadata for one canonical error identity.
- Field
Key - Opaque catalog key for a context field of marker type
T. - Field
Schema - Immutable schema for one catalog-owned context field.
- Filter
Compile Error - A redaction-safe SQL filter compilation error.
- Grpc
Spec - Represents grpc spec.
- Http
Spec - Represents http spec.
- Http
Status Code - HTTP status-code primitive.
- I64Field
- Marker for signed integer fields.
- Projection
Spec - Explicit boundary projections owned by an error descriptor.
- Public
Error View - A borrowed public projection of one descriptor-validated error context.
- Public
Fields - A borrowed descriptor-ordered iterator over public context fields.
- Remoting
Spec - Represents remoting spec.
- Secret
Presence Field - Marker for value-free secret-presence fields.
- Sensitive
- Wrapper for values that must never be formatted directly.
- Text
Field - Marker for bounded text fields.
- U64Field
- Marker for unsigned integer fields.
- View
Field Ref - A borrowed field exposed by a descriptor-validated view.
Enums§
- Backtrace
Policy - Catalog-controlled backtrace capture policy.
- Canonical
Condition - Protocol-independent condition assigned by a canonical error descriptor.
- CliVerbosity
- Controls how much safe diagnostic information a CLI error line contains.
- Context
Visibility - Controls which error projections may observe a context field.
- Error
Severity - Default severity for logs, metrics, traces, and alert routing.
- Exposure
- Public-context exposure policy for a descriptor.
- Fault
Attribution - Party or resource attributed with a canonical failure.
- Field
Value Kind - Closed vocabulary of values supported by structured error context.
- Field
Value Ref - Borrowed value of a structured context field.
- Filter
Compile Error Kind - The category of a SQL filter compilation failure.
- Filter
Compile Source - A fixed, redaction-safe source classification for filter compilation.
- Filter
Compile Stage - The SQL compilation stage at which a filter failure occurred.
- Grpc
Payload Code - gRPC payload-code primitive.
- Grpc
Status Code - Transport-level gRPC status primitive.
- Recovery
Hint - Catalog-owned recovery advice for a canonical error descriptor.
- Remoting
Response Code - Remoting response-code primitive.
- View
Context Violation - A descriptor/context contract violation discovered while creating a safe view.
- View
Value Ref - 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. - Shared
Error - Shared ownership of one canonical
Errorinstance.