forked from rojo-rbx/rojo
Delete ErrorDisplay, use anyhow instead!
This commit is contained in:
@@ -9,7 +9,6 @@ use memofs::{IoResultExt, Vfs, VfsEvent};
|
||||
use rbx_dom_weak::{RbxId, RbxValue};
|
||||
|
||||
use crate::{
|
||||
error::ErrorDisplay,
|
||||
message_queue::MessageQueue,
|
||||
snapshot::{
|
||||
apply_patch_set, compute_patch_set, AppliedPatchSet, InstigatingSource, PatchSet, RojoTree,
|
||||
@@ -313,7 +312,7 @@ fn compute_and_apply_changes(tree: &mut RojoTree, vfs: &Vfs, id: RbxId) -> Optio
|
||||
apply_patch_set(tree, patch_set)
|
||||
}
|
||||
Err(err) => {
|
||||
log::error!("Error processing filesystem change: {}", ErrorDisplay(err));
|
||||
log::error!("Error processing filesystem change: {:?}", err);
|
||||
return None;
|
||||
}
|
||||
},
|
||||
|
||||
18
src/error.rs
18
src/error.rs
@@ -1,18 +0,0 @@
|
||||
use std::{error::Error, fmt};
|
||||
|
||||
/// Wrapper type to print errors with source-chasing.
|
||||
pub struct ErrorDisplay<E>(pub E);
|
||||
|
||||
impl<E: Error> fmt::Display for ErrorDisplay<E> {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
writeln!(formatter, "{}", self.0)?;
|
||||
|
||||
let mut current_err: &dyn Error = &self.0;
|
||||
while let Some(source) = current_err.source() {
|
||||
writeln!(formatter, " caused by {}", source)?;
|
||||
current_err = &*source;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ mod tree_view;
|
||||
|
||||
mod auth_cookie;
|
||||
mod change_processor;
|
||||
mod error;
|
||||
mod glob;
|
||||
mod lua_ast;
|
||||
mod message_queue;
|
||||
|
||||
Reference in New Issue
Block a user