pub enum NbError {
CommandFailed(String),
NotFound,
Io(Error),
UnsupportedShowTarget {
selector: String,
actual_type: String,
},
DuplicateTitleHeading {
title: String,
heading: String,
},
}Expand description
Errors from nb CLI invocation.
Variants§
CommandFailed(String)
NotFound
Io(Error)
UnsupportedShowTarget
nb show was invoked on a selector whose type is not
classified as text by nb itself (per
add-0-2-0-foundation public-API spec). Folders, archives,
audio, video, image, and any other non-textual type reach
this path. The classification delegates to
nb show <selector> --type text so forward compatibility
is automatic when nb adds new textual types. Probe
failure (e.g., selector not found) does NOT route here;
it falls through to the original CommandFailed error
from the content-read path.
DuplicateTitleHeading
nb add was called with a title and content where the
first nonblank line of content is an exact Markdown ATX H1
duplicating the title. The validation runs in the caller
process before any subprocess invocation or notebook side
effect (including resolve_notebook); the rejection
happens entirely in-process. heading carries the exact
detected source line (including the leading # and any
surrounding whitespace) for actionable diagnostics. See
add-0-2-0-foundation public-API specification.
Trait Implementations§
Source§impl Error for NbError
impl Error for NbError
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()