pub struct AppError {
pub kind: ErrorKind,
pub message: String,
pub details: Option<ErrorDetails>,
}Expand description
Structured error type for Tauri commands.
Serialized as {"kind": "Database", "message": "..."} so the frontend
can branch on kind while still showing a human-readable message.
details carries machine-readable specifics for the few kinds where the
caller has to do more than print the message. It is omitted from the wire
format when absent, so every existing consumer is unaffected.
Fields§
§kind: ErrorKind§message: String§details: Option<ErrorDetails>Implementations§
Source§impl AppError
impl AppError
pub fn not_found(msg: impl Into<String>) -> Self
pub fn project_restore_required(msg: impl Into<String>) -> Self
pub fn invalid_input(msg: impl Into<String>) -> Self
pub fn cancelled(msg: impl Into<String>) -> Self
Sourcepub fn db(e: impl Display) -> Self
pub fn db(e: impl Display) -> Self
Convert an anyhow::Error originating from database operations.
Sourcepub fn classify_git_error(e: impl Display) -> Self
pub fn classify_git_error(e: impl Display) -> Self
Classify a git operation error into cancellation, network, or generic git error.
Sourcepub fn network(e: impl Display) -> Self
pub fn network(e: impl Display) -> Self
Convert an anyhow::Error originating from network operations.
Sourcepub fn io_with_context(error: Error) -> Self
pub fn io_with_context(error: Error) -> Self
Preserve the cause chain of a contextual filesystem failure for the UI.
Sourcepub fn target_conflict(
message: impl Into<String>,
conflicts: Vec<TargetConflictDetail>,
) -> Self
pub fn target_conflict( message: impl Into<String>, conflicts: Vec<TargetConflictDetail>, ) -> Self
A deployment refusal, with the paths that stopped it. Callers that drive this programmatically (the CLI, and the frontend toast) need the paths, not a sentence containing them.
pub fn internal(e: impl Display) -> Self
Trait Implementations§
Source§impl Error for AppError
impl Error for AppError
1.30.0 · 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()
Auto Trait Implementations§
impl Forget for AppError
impl Freeze for AppErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<TargetConflictDetail>: Freeze,
impl Move for AppError
impl RefUnwindSafe for AppError
impl Send for AppErrorwhere
RawVecInner: Send,
impl Sync for AppErrorwhere
RawVecInner: Sync,
impl Unpin for AppError
impl UnsafeUnpin for AppErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<TargetConflictDetail>: UnsafeUnpin,
impl UnwindSafe for AppErrorwhere
RawVecInner: UnwindSafe,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> IpcResponse for Twhere
T: Serialize,
impl<T> IpcResponse for Twhere
T: Serialize,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.