Fix issues relating to app directory changes (#5826)
* Fix canceling app directory change * Improve directory moving error messages * tombi
This commit is contained in:
@@ -16,6 +16,9 @@ pub struct LabrinthError {
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum ErrorKind {
|
||||
#[error("{0:?}")]
|
||||
Any(eyre::Report),
|
||||
|
||||
#[error("Filesystem error: {0}")]
|
||||
FSError(String),
|
||||
|
||||
@@ -214,6 +217,17 @@ impl<E: Into<ErrorKind>> From<E> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<eyre::Report> for Error {
|
||||
fn from(value: eyre::Report) -> Self {
|
||||
let error = Arc::new(ErrorKind::Any(value));
|
||||
|
||||
Self {
|
||||
raw: error.clone(),
|
||||
source: error.in_current_span(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ErrorKind {
|
||||
pub fn as_error(self) -> Error {
|
||||
self.into()
|
||||
|
||||
Reference in New Issue
Block a user