#[non_exhaustive]pub enum CodeModeError {
NotBunBinary(&'static str),
ModuleNotFound,
PatternInvalid {
name: &'static str,
source: Error,
},
AnchorCount {
name: &'static str,
found: usize,
},
ReplacementTooShort {
name: &'static str,
matched: usize,
replacement: usize,
},
Io(Error),
Sign(String),
Settings,
UnsupportedPlatform,
NoCacheDir,
UnsafeCache {
path: PathBuf,
reason: &'static str,
},
}Expand description
Error building the Code Mode binary.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotBunBinary(&'static str)
The CLI binary is not a Bun standalone executable this patch can read; the payload names the check that failed.
ModuleNotFound
No module contains the Code Mode opt-in marker.
PatternInvalid
A patch anchor’s regex does not compile.
AnchorCount
A patch anchor did not match exactly once.
ReplacementTooShort
A patch anchor matched fewer bytes than its replacement needs.
Fields
Io(Error)
A filesystem operation on the CLI binary or its patched copy failed,
or codesign could not run or timed out.
Sign(String)
codesign failed on the patched binary (macOS).
Settings
SessionOptions::settings (or its env) is not a JSON object.
UnsupportedPlatform
Code Mode was requested on a platform other than macOS or Linux.
NoCacheDir
Neither XDG_CACHE_HOME nor HOME is an absolute path, so there is
no per-user directory to cache the patched CLI in.
UnsafeCache
Another user could write the cache directory or the cached CLI, so the SDK refuses to run it.
Trait Implementations§
Source§impl Debug for CodeModeError
impl Debug for CodeModeError
Source§impl Display for CodeModeError
impl Display for CodeModeError
Source§impl Error for CodeModeError
impl Error for CodeModeError
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()