pub enum PlexusError {
ActivationNotFound(String),
MethodNotFound {
activation: String,
method: String,
},
InvalidParams {
param: Option<String>,
problem: ParamProblem,
},
ExecutionError(String),
HandleNotSupported(String),
TransportError(TransportErrorKind),
Unauthenticated(String),
Forbidden {
reason: AuthzDenyReason,
},
}Expand description
Why the service could not or would not run a call — the server side of the
wire’s RemoteError.
Every variant converts to a RemoteError (From<&PlexusError>), which
is what crosses the wire: in an error frame
(PlexusStreamItem::error(metadata, RemoteError::from(&e), recoverable))
and in the data of a JSON-RPC rejection (plexus_error_to_jsonrpc).
Variants§
ActivationNotFound(String)
MethodNotFound
InvalidParams
The call’s params did not fit the method (RETURNS-6: structured, was
InvalidParams(String)). param names the parameter at fault when
the failure is about one; problem says what is wrong with it.
ExecutionError(String)
HandleNotSupported(String)
TransportError(TransportErrorKind)
Unauthenticated(String)
Forbidden
Layer-2+ denial from the layered denial model (AUTHZ-0 §4, R-5): the caller is authenticated but the call is not authorized.
Produced by the scope gate ([super::scope_gate]) when a required
scope is unmet. The full wire-side rendering policy is
AUTHZ-PRIVACY-4’s (plexus_error_to_jsonrpc); this variant only
commits to the typed server-side value.
Fields
reason: AuthzDenyReasonImplementations§
Source§impl PlexusError
impl PlexusError
Sourcepub fn invalid_params(detail: impl Into<String>) -> Self
pub fn invalid_params(detail: impl Into<String>) -> Self
InvalidParams naming no one parameter: detail says what is wrong
(Invalid params: <detail>).
Trait Implementations§
Source§impl Clone for PlexusError
impl Clone for PlexusError
Source§impl Debug for PlexusError
impl Debug for PlexusError
Source§impl Display for PlexusError
impl Display for PlexusError
Source§impl Error for PlexusError
impl Error for PlexusError
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<&PlexusError> for RemoteError
RETURNS-6: the server’s failure, as the wire carries it.
impl From<&PlexusError> for RemoteError
RETURNS-6: the server’s failure, as the wire carries it.
PlexusError | RemoteError |
|---|---|
ActivationNotFound(name) | ActivationNotFound { activation: name } |
MethodNotFound { activation, method } | same |
InvalidParams { param, problem } | same |
ExecutionError(msg) | Execution { message: msg } |
HandleNotSupported(ns) | HandleNotSupported { activation: ns } |
TransportError(kind) — a service forwarding upstream failed | Execution { message: kind.to_string() } |
Unauthenticated(_) | Unauthenticated — the server-side reason stays server-side |
Forbidden { reason } | Forbidden { reason: DenyReason } |
Forbidden renders at most the single fact the caller already failed
(AUTHZ-CORE-1/5): MissingScope names the one unmet scope — the fact
the 0.6 wire already carried in its Display line — and
TenantBoundary / NotAccepted carry nothing.