pub enum ProviderError {
Transport(String),
Diagnostics(Vec<Diag>),
NoNewState,
PartiallyApplied {
diags: Vec<Diag>,
state: Box<DynamicValue>,
},
Schema(SchemaError),
}Expand description
── THE PROTOCOL DATA MODEL MOVED TO magma-provider-api ────────────
ProviderSchema, PlannedChange, Diag, Severity, ProviderError
and is_retryable were defined here. They describe what a provider
SAYS, not how it is reached, so they now live in the contract crate —
which depends on magma-cty alone, so a native provider can implement
the contract without dragging in tonic.
The edge had to point this way: magma-provider-api declares the
Provider trait, and THIS crate implements it, so the types could not
stay in the crate the trait crate would have had to depend on.
Re-exported unchanged, so every magma_plugin::provider::<T> path
still resolves. Relocation, not redesign.
Variants§
Transport(String)
Diagnostics(Vec<Diag>)
NoNewState
PartiallyApplied
The provider returned an error diagnostic AND a new_state — the
resource IS (at least partially) committed provider-side.
This is not a rare edge: it is how the tfplugin contract expresses a
partial apply, and how Terraform core knows to persist a
half-created resource. AWS EIP is the canonical shape —
AllocateAddress commits, a follow-up call (tagging, association, the
post-create read) fails, and the provider returns the allocation id
together with an error.
Before this variant existed, check_diags(...)? ran BEFORE
new_state was read, so that state was thrown away and the caller
recorded nothing. The next reconcile re-planned a CREATE and allocated
a SECOND resource. Measured 2026-08-01: two orphaned EIPs
(3.151.179.36, 18.227.192.150), each billable, neither in state, while
the run reported created: 0.
Carrying the state in the ERROR — rather than returning Ok — keeps
the apply correctly failed while making the committed resource
impossible to drop on the floor: a caller must destructure this
variant to handle the error at all.
Schema(SchemaError)
Trait Implementations§
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
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<SchemaError> for ProviderError
impl From<SchemaError> for ProviderError
Source§fn from(source: SchemaError) -> ProviderError
fn from(source: SchemaError) -> ProviderError
Auto Trait Implementations§
impl Freeze for ProviderError
impl RefUnwindSafe for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin for ProviderError
impl UnsafeUnpin for ProviderError
impl UnwindSafe for ProviderError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request