Skip to main content

DocError

Enum DocError 

Source
#[non_exhaustive]
pub enum DocError {
Show 17 variants Io { path: PathBuf, source: Error, }, Yaml(String), UnknownField(String), NotTestDocument { path: PathBuf, }, MissingScenario, MixedVocabulary { found: String, }, RouteSourceMissing, RouteSourceConflict { present: String, }, Validation { index: usize, message: String, }, UnsupportedProvisioning { value: String, endpoint: String, }, ProvisioningWithoutAuthority { endpoint: String, ref_scheme: String, }, ReservedEnvKey { key: String, endpoint: String, }, Partners { endpoint: String, message: String, }, InlineRoutes(String), InlineRoutesRejected, ExpectReplyOnUnsupportedSend { index: usize, scheme: String, }, LogsBlock { detail: String, },
}
Expand description

Parse and validation errors for scenario documents.

Exit-code mapping for the CLI adapter (ADR-0069 section 7): classification is by variant, never by message text. Every variant is a load-time failure and maps to exit 2.

  • doc-validation class — Display carries the doc-validation: token: NotTestDocument, MissingScenario, MixedVocabulary, Validation, ReservedEnvKey, InlineRoutes, InlineRoutesRejected, ProvisioningWithoutAuthority, ExpectReplyOnUnsupportedSend, LogsBlock.
  • infra-unavailable class — UnsupportedProvisioning (reserved provisioning grammar; Display names the class).
  • Unit-tier message parity — RouteSourceMissing and RouteSourceConflict render the unit-tier parser’s messages verbatim, without the token, so both parsers report identical text; the CLI maps them to exit 2 as doc parse errors, the same as the unit tier does today.
  • Read and serde failures — Io, Yaml, UnknownField map to exit 2 as doc parse errors (unreadable file, broken grammar).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Io

The document file could not be read.

Fields

§path: PathBuf

Path of the unreadable document.

§source: Error

Underlying read failure.

§

Yaml(String)

Malformed YAML or a type mismatch at the serde layer.

§

UnknownField(String)

A deny_unknown_fields rejection.

§

NotTestDocument

The path lacks the reserved .test.yaml / .test.yml suffix.

Fields

§path: PathBuf

The rejected path.

§

MissingScenario

The document declares no scenario: section.

§

MixedVocabulary

The document mixes the scenario vocabulary with unit-tier sections.

Fields

§found: String

The unit-tier fields found, backticked and comma-joined.

§

RouteSourceMissing

No route source is declared. Same message as the unit-tier parser.

§

RouteSourceConflict

More than one route source is declared. Same message as the unit-tier parser.

Fields

§present: String

The declared keys, backticked and comma-joined.

§

Validation

An action failed validation; index is the position in the scenario: list. An empty scenario: list is rejected with index 0 (the section, not an action, failed).

Fields

§index: usize

Zero-based position of the action in the scenario: list.

§message: String

What failed.

§

UnsupportedProvisioning

The endpoint declares a provisioning source that is reserved in v1; only harness is supported.

Fields

§value: String

The rejected provisioning value.

§endpoint: String

The endpoint that declared it.

§

ProvisioningWithoutAuthority

A provisioning: harness endpoint reference declares a bindVar while its scheme (direct: or fake:) binds no partner, so the variable would never receive a bound authority and the entry fails later as a verdict-class var-resolution error (rc-j87j). Rejected at load instead.

Fields

§endpoint: String

The endpoint whose reference cannot fill the variable.

§ref_scheme: String

The scheme of the endpoint reference (direct or fake).

§

ReservedEnvKey

A document env key equals an endpoint’s bindVar. The reserved set is exactly the bindVar values declared by the document’s own endpoints; the harness binding wins.

Fields

§key: String

The reserved key.

§endpoint: String

The endpoint that reserved it.

§

Partners

A partners entry failed validation; endpoint is the entry key of the failing script list.

Fields

§endpoint: String

The endpoint key of the failing entry.

§message: String

What failed.

§

InlineRoutes(String)

Inline routes failed to parse.

§

InlineRoutesRejected

The document’s route source is inline routes. Inline definitions cannot boot in v1; the author must declare routeFiles. Rejected at load, before partners bind, instead of failing the boot afterward (rc-9dpx).

§

ExpectReplyOnUnsupportedSend

A send declares expectReply on a scheme that produces no synchronous reply: only the context-stimulus direct: send returns one. Partner sends (http/https) park their roundtrips for a later receive, and fake: adapters record sends without answering, so the assertion could never run (rc-qvz6). Rejected at load, naming the action index, the scheme, and the literal expectReply field.

Fields

§index: usize

Zero-based position of the action in the scenario: list.

§scheme: String

The scheme of the send’s endpoint reference.

§

LogsBlock

A malformed document-level logs: block (rc-tdgh5): an unknown key, a level outside the accepted set, or a regex that does not compile. The detail names the offending clause.

Fields

§detail: String

The offending clause and why it failed.

Trait Implementations§

Source§

impl Debug for DocError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DocError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for DocError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more