pub enum RailError {
Config(ConfigError),
Git(GitError),
Io(Error),
Message {
message: String,
context: Option<String>,
help: Option<String>,
},
CheckHasPendingChanges,
ExitWithCode {
code: i32,
},
}Expand description
Main error type for cargo-rail
Variants§
Config(ConfigError)
Configuration errors
Git(GitError)
Git operation errors
Io(Error)
I/O errors
Message
Generic error with message and optional context
Fields
CheckHasPendingChanges
Check mode found pending changes (not an error, but exits with code 1)
Used by –check commands to signal that changes would be made. This is not a failure, but CI should treat it as “action needed”.
ExitWithCode
Exit with specific code (no error message printed)
Used for:
- Propagating subprocess exit codes (e.g., cargo test failures)
- Silent exits after JSON output has been written
- Any case where we need a specific exit code without error output
Implementations§
Trait Implementations§
Source§impl Error for RailError
impl Error for RailError
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()
Source§impl From<FromUtf8Error> for RailError
impl From<FromUtf8Error> for RailError
Source§fn from(err: FromUtf8Error) -> Self
fn from(err: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for RailError
impl From<ParseIntError> for RailError
Source§fn from(err: ParseIntError) -> Self
fn from(err: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl From<StripPrefixError> for RailError
impl From<StripPrefixError> for RailError
Source§fn from(err: StripPrefixError) -> Self
fn from(err: StripPrefixError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RailError
impl !RefUnwindSafe for RailError
impl Send for RailError
impl Sync for RailError
impl Unpin for RailError
impl !UnwindSafe for RailError
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 more