#[non_exhaustive]pub enum SpiError {
PartitionUnresolved {
tried: Vec<PartitionKeySpecKind>,
},
PlacementMissing {
partition: PartitionId,
},
PlacementBackend {
retryable: bool,
},
UnsupportedEndpoint {
endpoint: EndpointKind,
},
PrincipalAttrMissing {
attr: String,
},
HeaderMissing {
header: String,
},
IdRuleMissingPartition,
}Expand description
A failure returned by RoutingSpi or TenancySpi.
§Examples
use osproxy_spi::SpiError;
use osproxy_spi::core::ErrorCode;
let err = SpiError::PlacementBackend { retryable: true };
assert_eq!(err.code(), ErrorCode::PlacementBackendUnavailable);
assert!(err.retryable());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PartitionUnresolved
The partition could not be resolved from the request. Reports which source kinds were attempted (shape only).
Fields
tried: Vec<PartitionKeySpecKind>The source kinds tried, in order, before giving up.
PlacementMissing
No placement exists for the resolved partition.
Fields
partition: PartitionIdThe unresolved partition (an id, safe in telemetry).
PlacementBackend
The placement-lookup backend was unavailable.
UnsupportedEndpoint
The request endpoint is not supported for tenancy rewriting in this mode.
Fields
endpoint: EndpointKindThe endpoint classification that was rejected.
PrincipalAttrMissing
An injected field draws its value from a principal attribute that the authenticated principal does not carry. A configuration/identity mismatch, surfaced as a routing failure rather than silently injecting a null (which would corrupt isolation).
HeaderMissing
An injected field draws its value from a request header the request does not carry. Surfaced as a routing failure rather than injecting a null.
IdRuleMissingPartition
A SharedIndex placement was configured with a doc-id rule that does not
include the partition id, which would allow cross-tenant id collisions
(docs/03). A configuration error, surfaced as a routing failure.
Implementations§
Trait Implementations§
Source§impl Error for SpiError
impl Error for SpiError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()