pub enum NrsError {
Show 18 variants
NoPackageJson {
path: PathBuf,
depth: usize,
},
ParseErrorWithContext {
path: PathBuf,
message: String,
line: Option<usize>,
column: Option<usize>,
},
ParseError(Error),
NoScriptsAt {
path: PathBuf,
},
NoScripts,
EmptyScripts {
path: PathBuf,
},
InvalidScriptsType {
path: PathBuf,
actual_type: String,
},
ScriptNotFound {
name: String,
},
ScriptNotFoundWithSuggestions {
name: String,
suggestions: String,
},
ScriptFailed {
name: String,
code: i32,
},
ConfigError {
message: String,
},
InvalidConfig {
path: PathBuf,
message: String,
},
TerminalTooSmall {
width: u16,
height: u16,
min_width: u16,
min_height: u16,
},
NoHistory,
AllScriptsExcluded {
total: usize,
patterns: String,
},
NoFilterMatch {
filter: String,
},
IoWithContext {
operation: String,
path: PathBuf,
source: Error,
},
Io(Error),
}Expand description
Main error type for nrs.
Variants§
NoPackageJson
No package.json found.
ParseErrorWithContext
Failed to parse package.json with location details.
ParseError(Error)
Failed to parse package.json (legacy, kept for From impl).
NoScriptsAt
No scripts defined in package.json.
NoScripts
No scripts defined in package.json (legacy).
EmptyScripts
Empty scripts object.
InvalidScriptsType
Scripts field is not an object.
ScriptNotFound
Script not found.
ScriptNotFoundWithSuggestions
Script not found with suggestions.
ScriptFailed
Script execution failed.
ConfigError
Configuration error.
InvalidConfig
Invalid configuration file.
TerminalTooSmall
Terminal too small.
NoHistory
No history found for rerun.
AllScriptsExcluded
All scripts excluded by patterns.
NoFilterMatch
No scripts match filter.
IoWithContext
IO error with path context.
Io(Error)
IO error.
Implementations§
Trait Implementations§
Source§impl Error for NrsError
impl Error for NrsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for NrsError
impl !RefUnwindSafe for NrsError
impl Send for NrsError
impl Sync for NrsError
impl Unpin for NrsError
impl !UnwindSafe for NrsError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more