Skip to main content

HostError

Enum HostError 

Source
pub enum HostError {
    Config {
        message: String,
    },
    VenvBuild {
        message: String,
    },
    VenvCommand {
        step: &'static str,
        context: String,
        output: ProcessOutput,
    },
    WorkerStart {
        message: String,
    },
    WorkerDied {
        message: String,
    },
    Timeout {
        timeout_secs: u64,
    },
    TaskTooLarge {
        size: usize,
        limit: usize,
    },
    ResponseTooLarge {
        size: usize,
        limit: usize,
    },
    WorkerError {
        message: String,
    },
    Protocol {
        message: String,
    },
    Credential {
        message: String,
    },
    LegacyShim {
        hook: String,
        message: String,
    },
}
Expand description

A failure inside the host, before or around the plugin’s own logic.

Variants§

§

Config

The plugin’s configuration cannot support a venv (no plugin dirs, an unusable class name).

Fields

§message: String
§

VenvBuild

Building the virtualenv or installing its requirements failed.

Fields

§message: String
§

VenvCommand

A venv build step that ran a child process and got a non-zero exit.

Split out from Self::VenvBuild so the exit code and stderr survive as structured details on the PluginError instead of being flattened into prose a caller has to string-match. step names the command that failed (“python3 -m venv”, “pip install”) and context the thing it was acting on (the venv path, the requirements file).

Carries process output — see the redaction note on ProcessOutput.

Fields

§step: &'static str
§context: String
§

WorkerStart

The worker subprocess could not be launched.

Fields

§message: String
§

WorkerDied

The worker process is gone — reader EOF, or a non-zero exit — while a request was outstanding. Distinct from a timeout: there is nothing left to wait for.

Fields

§message: String
§

Timeout

No response arrived within the per-invocation timeout.

Fields

§timeout_secs: u64
§

TaskTooLarge

The serialized task exceeded the configured max_content_size. Caught before the write, so nothing was sent.

Fields

§size: usize
§limit: usize
§

ResponseTooLarge

A worker response frame exceeded the configured max_content_size. Detected mid-read, so the frame was discarded rather than buffered.

Fields

§size: usize
§limit: usize
§

WorkerError

The worker returned a structured error response for this request.

Fields

§message: String
§

Protocol

A payload or response could not be serialized or parsed.

The message must never carry payload values — only the shape of the failure (which field, which type), since it reaches logs.

Fields

§message: String
§

Credential

A credential-bearing hook could not be served safely, so the host failed closed rather than dispatching without the token.

The message never contains token material.

Fields

§message: String
§

LegacyShim

A cmf.* hook could not be translated for a worker that predates cmf.* hook support, so the host failed closed rather than dispatching a payload the plugin would misread or skipping the plugin.

Like Protocol, the message names shapes (part types, field names), never payload values.

Fields

§hook: String
§message: String

Implementations§

Source§

impl HostError

Source

pub fn code(&self) -> &'static str

Short, stable code for the PluginError::Execution.code field, so a host can branch on the failure mode without string-matching messages.

Source

pub fn details(&self) -> HashMap<String, Value>

Machine-readable diagnostics for PluginError::Execution.details.

The Display message is prose for a human; this is the same facts in a form an operator’s log pipeline or a test can match on without parsing English. A failed pip install is the motivating case: its exit code and stderr tail land here rather than only inside the message string.

Variants whose fields are already fully described by the message (and carry no structured facts beyond it) contribute nothing, so the map is empty for them rather than padded with a duplicate of the message.

Every value here reaches logs, so nothing that could hold credential material — payload values, token bytes — is admitted. The one variant carrying child-process output is gated by the redaction note on ProcessOutput.

Source

pub fn into_plugin_error(self, plugin_name: &str) -> Box<PluginError>

Convert to the framework error type for a named plugin.

A timeout becomes PluginError::Timeout so the executor’s existing timeout accounting applies; a config fault becomes PluginError::Config; everything else is an Execution error the executor routes through the plugin’s on_error policy.

Trait Implementations§

Source§

impl Debug for HostError

Source§

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

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

impl Display for HostError

Source§

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

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

impl Error for HostError

1.30.0 · 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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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<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