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.
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.
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.
Implementations§
Source§impl BntoError
impl BntoError
Sourcepub fn with_output(error: BntoError, output: NodeOutput) -> Self
pub fn with_output(error: BntoError, output: NodeOutput) -> Self
error, handing over output along with the failure. Replaces any
output error already carried.
Sourcepub fn is_timeout(&self) -> bool
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.
Sourcepub fn into_parts(self) -> (BntoError, Option<NodeOutput>)
pub fn into_parts(self) -> (BntoError, Option<NodeOutput>)
The error itself and the output it handed over, if any.
Trait Implementations§
Source§impl Error for BntoError
impl Error for BntoError
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()