pub enum BntoError {
InvalidInput(String),
UnsupportedFormat(String),
ProcessingFailed(String),
Cancelled,
FileTooLarge(u64),
OutOfMemory(String),
}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.
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.
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()