pub struct CommandError {
pub kind: CommandErrorKind,
pub error: Arc<dyn Error + Send + Sync>,
pub hints: Vec<ErrorHint>,
}
Fields§
§kind: CommandErrorKind
§error: Arc<dyn Error + Send + Sync>
§hints: Vec<ErrorHint>
Implementations§
Source§impl CommandError
impl CommandError
pub fn new( kind: CommandErrorKind, err: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
pub fn with_message( kind: CommandErrorKind, message: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Sourcepub fn hinted(self, hint: impl Into<String>) -> Self
pub fn hinted(self, hint: impl Into<String>) -> Self
Returns error with the given plain-text hint
attached.
Sourcepub fn add_formatted_hint(&mut self, hint: FormatRecorder)
pub fn add_formatted_hint(&mut self, hint: FormatRecorder)
Appends formatted hint
to the error.
Sourcepub fn add_formatted_hint_with(
&mut self,
write: impl FnOnce(&mut dyn Formatter) -> Result<()>,
)
pub fn add_formatted_hint_with( &mut self, write: impl FnOnce(&mut dyn Formatter) -> Result<()>, )
Constructs formatted hint and appends it to the error.
Sourcepub fn extend_hints(&mut self, hints: impl IntoIterator<Item = String>)
pub fn extend_hints(&mut self, hints: impl IntoIterator<Item = String>)
Appends 0 or more plain-text hints
to the error.
Trait Implementations§
Source§impl Clone for CommandError
impl Clone for CommandError
Source§fn clone(&self) -> CommandError
fn clone(&self) -> CommandError
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CommandError
impl Debug for CommandError
Source§impl From<AbsorbError> for CommandError
impl From<AbsorbError> for CommandError
Source§fn from(err: AbsorbError) -> Self
fn from(err: AbsorbError) -> Self
Converts to this type from the input type.
Source§impl From<BackendError> for CommandError
impl From<BackendError> for CommandError
Source§fn from(err: BackendError) -> Self
fn from(err: BackendError) -> Self
Converts to this type from the input type.
Source§impl From<CheckOutCommitError> for CommandError
impl From<CheckOutCommitError> for CommandError
Source§fn from(err: CheckOutCommitError) -> Self
fn from(err: CheckOutCommitError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigFileSaveError> for CommandError
impl From<ConfigFileSaveError> for CommandError
Source§fn from(err: ConfigFileSaveError) -> Self
fn from(err: ConfigFileSaveError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigGetError> for CommandError
impl From<ConfigGetError> for CommandError
Source§fn from(err: ConfigGetError) -> Self
fn from(err: ConfigGetError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigLoadError> for CommandError
impl From<ConfigLoadError> for CommandError
Source§fn from(err: ConfigLoadError) -> Self
fn from(err: ConfigLoadError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigMigrateError> for CommandError
impl From<ConfigMigrateError> for CommandError
Source§fn from(err: ConfigMigrateError) -> Self
fn from(err: ConfigMigrateError) -> Self
Converts to this type from the input type.
Source§impl From<ConflictResolveError> for CommandError
impl From<ConflictResolveError> for CommandError
Source§fn from(err: ConflictResolveError) -> Self
fn from(err: ConflictResolveError) -> Self
Converts to this type from the input type.
Source§impl From<DiffEditError> for CommandError
impl From<DiffEditError> for CommandError
Source§fn from(err: DiffEditError) -> Self
fn from(err: DiffEditError) -> Self
Converts to this type from the input type.
Source§impl From<DiffRenderError> for CommandError
impl From<DiffRenderError> for CommandError
Source§fn from(err: DiffRenderError) -> Self
fn from(err: DiffRenderError) -> Self
Converts to this type from the input type.
Source§impl From<EditCommitError> for CommandError
impl From<EditCommitError> for CommandError
Source§fn from(err: EditCommitError) -> Self
fn from(err: EditCommitError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for CommandError
impl From<Error> for CommandError
Source§impl From<Error> for CommandError
impl From<Error> for CommandError
Source§impl From<FilesetParseError> for CommandError
impl From<FilesetParseError> for CommandError
Source§fn from(err: FilesetParseError) -> Self
fn from(err: FilesetParseError) -> Self
Converts to this type from the input type.
Source§impl From<FixError> for CommandError
impl From<FixError> for CommandError
Source§impl From<GitExportError> for CommandError
impl From<GitExportError> for CommandError
Source§fn from(err: GitExportError) -> Self
fn from(err: GitExportError) -> Self
Converts to this type from the input type.
Source§impl From<GitFetchError> for CommandError
impl From<GitFetchError> for CommandError
Source§fn from(err: GitFetchError) -> Self
fn from(err: GitFetchError) -> Self
Converts to this type from the input type.
Source§impl From<GitIgnoreError> for CommandError
impl From<GitIgnoreError> for CommandError
Source§fn from(err: GitIgnoreError) -> Self
fn from(err: GitIgnoreError) -> Self
Converts to this type from the input type.
Source§impl From<GitImportError> for CommandError
impl From<GitImportError> for CommandError
Source§fn from(err: GitImportError) -> Self
fn from(err: GitImportError) -> Self
Converts to this type from the input type.
Source§impl From<GitPushError> for CommandError
impl From<GitPushError> for CommandError
Source§fn from(err: GitPushError) -> Self
fn from(err: GitPushError) -> Self
Converts to this type from the input type.
Source§impl From<GitRemoteManagementError> for CommandError
impl From<GitRemoteManagementError> for CommandError
Source§fn from(err: GitRemoteManagementError) -> Self
fn from(err: GitRemoteManagementError) -> Self
Converts to this type from the input type.
Source§impl From<GitResetHeadError> for CommandError
impl From<GitResetHeadError> for CommandError
Source§fn from(err: GitResetHeadError) -> Self
fn from(err: GitResetHeadError) -> Self
Converts to this type from the input type.
Source§impl From<MergeToolConfigError> for CommandError
impl From<MergeToolConfigError> for CommandError
Source§fn from(err: MergeToolConfigError) -> Self
fn from(err: MergeToolConfigError) -> Self
Converts to this type from the input type.
Source§impl From<MergeToolPartialResolutionError> for CommandError
impl From<MergeToolPartialResolutionError> for CommandError
Source§fn from(err: MergeToolPartialResolutionError) -> Self
fn from(err: MergeToolPartialResolutionError) -> Self
Converts to this type from the input type.
Source§impl From<OpHeadResolutionError> for CommandError
impl From<OpHeadResolutionError> for CommandError
Source§fn from(err: OpHeadResolutionError) -> Self
fn from(err: OpHeadResolutionError) -> Self
Converts to this type from the input type.
Source§impl From<OpHeadsStoreError> for CommandError
impl From<OpHeadsStoreError> for CommandError
Source§fn from(err: OpHeadsStoreError) -> Self
fn from(err: OpHeadsStoreError) -> Self
Converts to this type from the input type.
Source§impl From<OpStoreError> for CommandError
impl From<OpStoreError> for CommandError
Source§fn from(err: OpStoreError) -> Self
fn from(err: OpStoreError) -> Self
Converts to this type from the input type.
Source§impl From<OpsetEvaluationError> for CommandError
impl From<OpsetEvaluationError> for CommandError
Source§fn from(err: OpsetEvaluationError) -> Self
fn from(err: OpsetEvaluationError) -> Self
Converts to this type from the input type.
Source§impl From<ParseBulkEditMessageError> for CommandError
impl From<ParseBulkEditMessageError> for CommandError
Source§fn from(err: ParseBulkEditMessageError) -> Self
fn from(err: ParseBulkEditMessageError) -> Self
Converts to this type from the input type.
Source§impl From<PathError> for CommandError
impl From<PathError> for CommandError
Source§impl From<RecoverWorkspaceError> for CommandError
impl From<RecoverWorkspaceError> for CommandError
Source§fn from(err: RecoverWorkspaceError) -> Self
fn from(err: RecoverWorkspaceError) -> Self
Converts to this type from the input type.
Source§impl From<RenameWorkspaceError> for CommandError
impl From<RenameWorkspaceError> for CommandError
Source§fn from(err: RenameWorkspaceError) -> Self
fn from(err: RenameWorkspaceError) -> Self
Converts to this type from the input type.
Source§impl From<RepoLoaderError> for CommandError
impl From<RepoLoaderError> for CommandError
Source§fn from(err: RepoLoaderError) -> Self
fn from(err: RepoLoaderError) -> Self
Converts to this type from the input type.
Source§impl From<ResetError> for CommandError
impl From<ResetError> for CommandError
Source§fn from(err: ResetError) -> Self
fn from(err: ResetError) -> Self
Converts to this type from the input type.
Source§impl From<RevsetEvaluationError> for CommandError
impl From<RevsetEvaluationError> for CommandError
Source§fn from(err: RevsetEvaluationError) -> Self
fn from(err: RevsetEvaluationError) -> Self
Converts to this type from the input type.
Source§impl From<RevsetParseError> for CommandError
impl From<RevsetParseError> for CommandError
Source§fn from(err: RevsetParseError) -> Self
fn from(err: RevsetParseError) -> Self
Converts to this type from the input type.
Source§impl From<RevsetResolutionError> for CommandError
impl From<RevsetResolutionError> for CommandError
Source§fn from(err: RevsetResolutionError) -> Self
fn from(err: RevsetResolutionError) -> Self
Converts to this type from the input type.
Source§impl From<RewriteRootCommit> for CommandError
impl From<RewriteRootCommit> for CommandError
Source§fn from(err: RewriteRootCommit) -> Self
fn from(err: RewriteRootCommit) -> Self
Converts to this type from the input type.
Source§impl From<SnapshotError> for CommandError
impl From<SnapshotError> for CommandError
Source§fn from(err: SnapshotError) -> Self
fn from(err: SnapshotError) -> Self
Converts to this type from the input type.
Source§impl From<TempTextEditError> for CommandError
impl From<TempTextEditError> for CommandError
Source§fn from(err: TempTextEditError) -> Self
fn from(err: TempTextEditError) -> Self
Converts to this type from the input type.
Source§impl From<TemplateParseError> for CommandError
impl From<TemplateParseError> for CommandError
Source§fn from(err: TemplateParseError) -> Self
fn from(err: TemplateParseError) -> Self
Converts to this type from the input type.
Source§impl From<TextEditError> for CommandError
impl From<TextEditError> for CommandError
Source§fn from(err: TextEditError) -> Self
fn from(err: TextEditError) -> Self
Converts to this type from the input type.
Source§impl From<TrailerParseError> for CommandError
impl From<TrailerParseError> for CommandError
Source§fn from(err: TrailerParseError) -> Self
fn from(err: TrailerParseError) -> Self
Converts to this type from the input type.
Source§impl From<TransactionCommitError> for CommandError
impl From<TransactionCommitError> for CommandError
Source§fn from(err: TransactionCommitError) -> Self
fn from(err: TransactionCommitError) -> Self
Converts to this type from the input type.
Source§impl From<UiPathParseError> for CommandError
impl From<UiPathParseError> for CommandError
Source§fn from(err: UiPathParseError) -> Self
fn from(err: UiPathParseError) -> Self
Converts to this type from the input type.
Source§impl From<UnexpectedGitBackendError> for CommandError
impl From<UnexpectedGitBackendError> for CommandError
Source§fn from(err: UnexpectedGitBackendError) -> Self
fn from(err: UnexpectedGitBackendError) -> Self
Converts to this type from the input type.
Source§impl From<UserRevsetEvaluationError> for CommandError
impl From<UserRevsetEvaluationError> for CommandError
Source§fn from(err: UserRevsetEvaluationError) -> Self
fn from(err: UserRevsetEvaluationError) -> Self
Converts to this type from the input type.
Source§impl From<WalkPredecessorsError> for CommandError
impl From<WalkPredecessorsError> for CommandError
Source§fn from(err: WalkPredecessorsError) -> Self
fn from(err: WalkPredecessorsError) -> Self
Converts to this type from the input type.
Source§impl From<WorkingCopyStateError> for CommandError
impl From<WorkingCopyStateError> for CommandError
Source§fn from(err: WorkingCopyStateError) -> Self
fn from(err: WorkingCopyStateError) -> Self
Converts to this type from the input type.
Source§impl From<WorkspaceInitError> for CommandError
impl From<WorkspaceInitError> for CommandError
Source§fn from(err: WorkspaceInitError) -> Self
fn from(err: WorkspaceInitError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CommandError
impl !RefUnwindSafe for CommandError
impl Send for CommandError
impl Sync for CommandError
impl Unpin for CommandError
impl !UnwindSafe for CommandError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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