Skip to main content

BntoError

Enum BntoError 

Source
pub enum BntoError {
    InvalidInput(String),
    UnsupportedFormat(String),
    ProcessingFailed(String),
    Cancelled,
    TimedOut {
        secs: u64,
    },
    FileTooLarge(u64),
    OutOfMemory(String),
    CommandFailed {
        message: String,
        stdout: Vec<u8>,
    },
    FailedWithOutput(Box<FailedOutput>),
    ClosingStepFailed {
        first: Box<BntoError>,
        node_id: String,
        error: Box<BntoError>,
    },
}
Expand description

All possible errors from Bnto WASM node operations.

Each variant represents a different category of failure. The #[error("...")] attribute defines the display message.

Variants§

§

InvalidInput(String)

The input data is invalid (wrong type, missing required field, etc.). The string contains a human-readable explanation of what’s wrong.

§

UnsupportedFormat(String)

The file format isn’t supported by this node. For example, trying to compress a .bmp when we only support JPEG/PNG/WebP.

§

ProcessingFailed(String)

Something went wrong while processing the file. This is a catch-all for errors during the actual work (compression, CSV parsing, etc.). The string explains what happened.

§

Cancelled

The user cancelled the operation (or the Web Worker was terminated). Not a “real” error — the user chose to stop.

§

TimedOut

The run passed its time limit (settings.timeout, or the consumer’s override), so nothing more of it started.

Fields

§secs: u64
§

FileTooLarge(u64)

A file is too large for browser processing. Browser memory is limited (~2GB), so we check file sizes before trying to process them.

§

OutOfMemory(String)

The browser ran out of memory while processing. WASM has a limited memory heap. If we try to load a huge image, we might exhaust it.

§

CommandFailed

An external command ran and exited non-zero. stdout is what it printed, so a caller can still use it. Displays like ProcessingFailed.

Fields

§message: String
§stdout: Vec<u8>
§

FailedWithOutput(Box<FailedOutput>)

A step failed but still handed over output (e.g. a failed command’s stdout), which the run’s closing steps receive. Displays as the underlying error. Build with BntoError::with_output.

§

ClosingStepFailed

A closing step (a node marked always) failed after an earlier step had already failed the run. first stays the run’s verdict.

Fields

§node_id: String

Implementations§

Source§

impl BntoError

Source

pub fn with_output(error: BntoError, output: NodeOutput) -> Self

error, handing over output along with the failure. Replaces any output error already carried.

Source

pub fn is_timeout(&self) -> bool

Whether this failure is, or began with, the run passing its time limit. A timeout ends the run: no closing step or skipped loop item runs past it.

Source

pub fn into_parts(self) -> (BntoError, Option<NodeOutput>)

The error itself and the output it handed over, if any.

Trait Implementations§

Source§

impl Debug for BntoError

Source§

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

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

impl Display for BntoError

Source§

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

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

impl Error for BntoError

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