#[non_exhaustive]pub enum RewriteError {
NotAnObject,
InvalidJson,
ReservedFieldCollision {
field: FieldName,
},
PathNotScalar {
path: String,
},
UnsupportedPlaceholder {
placeholder: String,
},
MalformedBulkAction,
IrreversibleIdTemplate,
Unfilterable {
construct: &'static str,
},
}Expand description
A failure applying a body transform.
These are document-shape failures (the body is not what the transform requires) or safety failures (a client field would collide with an injected tenancy field). They carry only field names and shapes, never values, so they are safe to surface in telemetry (NFR-S2).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotAnObject
The body was expected to be a JSON object but was not.
InvalidJson
The body bytes were not valid JSON.
ReservedFieldCollision
A field the transform must inject already exists in the client document.
Rejected rather than overwritten: a client could otherwise spoof a
tenancy field and defeat isolation (docs/03).
PathNotScalar
A path referenced by a partition key or id template does not resolve to a scalar value in the document.
UnsupportedPlaceholder
An id template referenced a placeholder the transform does not support.
MalformedBulkAction
A _bulk action line is not a single-key {verb: {…}} object, names an
unknown verb, or an action that needs a source line has none.
IrreversibleIdTemplate
An id template cannot be reversed to recover a logical id on the read
path: a logical→physical mapping needs exactly one {body.<path>}
placeholder (the natural key), so a template with none or several is not
usable for GetById/DeleteById (docs/03 §4, docs/04 §5).
Unfilterable
A shared-index search carries a construct that escapes the mandatory
partition filter, a global aggregation (which OpenSearch evaluates
against the whole index, ignoring the query) or a suggest block (which
runs independent of the query). Either would read across partitions, so
it is refused: the isolation boundary is filter-or-reject, never
best-effort (docs/03 §5, NFR-S4). Carries only the construct name.
Trait Implementations§
Source§impl Debug for RewriteError
impl Debug for RewriteError
Source§impl Display for RewriteError
impl Display for RewriteError
impl Eq for RewriteError
Source§impl Error for RewriteError
impl Error for RewriteError
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()
Source§impl From<JsonError> for RewriteError
Maps a byte-scanner failure onto the transform error vocabulary, so the
byte-level inject/id primitives surface the same variants as the Value path.
impl From<JsonError> for RewriteError
Maps a byte-scanner failure onto the transform error vocabulary, so the
byte-level inject/id primitives surface the same variants as the Value path.
Source§impl PartialEq for RewriteError
impl PartialEq for RewriteError
Source§fn eq(&self, other: &RewriteError) -> bool
fn eq(&self, other: &RewriteError) -> bool
self and other values to be equal, and is used by ==.