Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: update error message

nathanf29f1bae32f8
diff --git a/frontend/rust-lib/flowy-folder/src/event_handler.rs b/frontend/rust-lib/flowy-folder/src/event_handler.rs
index 7eee016727..a5412decc6 100644
--- a/frontend/rust-lib/flowy-folder/src/event_handler.rs
+++ b/frontend/rust-lib/flowy-folder/src/event_handler.rs
@@ -102,6 +102,7 @@ pub(crate) async fn create_orphan_view_handler(
data_result_ok(view_pb_without_child_views(Arc::new(view)))
}
+#[tracing::instrument(level = "debug", skip(data, folder), err)]
pub(crate) async fn read_view_handler(
data: AFPluginData<ViewIdPB>,
folder: AFPluginState<Weak<FolderManager>>,
diff --git a/frontend/rust-lib/flowy-folder/src/manager.rs b/frontend/rust-lib/flowy-folder/src/manager.rs
index a2e8d951e6..cf782c7586 100644
--- a/frontend/rust-lib/flowy-folder/src/manager.rs
+++ b/frontend/rust-lib/flowy-folder/src/manager.rs
@@ -455,7 +455,7 @@ impl FolderManager {
/// Returns the view with the given view id.
/// The child views of the view will only access the first. So if you want to get the child view's
/// child view, you need to call this method again.
- #[tracing::instrument(level = "debug", skip(self, view_id), err)]
+ #[tracing::instrument(level = "debug", skip(self))]
pub async fn get_view_pb(&self, view_id: &str) -> FlowyResult<ViewPB> {
let view_id = view_id.to_string();
let folder = self.mutex_folder.lock();
@@ -467,11 +467,17 @@ impl FolderManager {
.collect::<Vec<String>>();
if trash_ids.contains(&view_id) {
- return Err(FlowyError::record_not_found());
+ return Err(FlowyError::new(
+ ErrorCode::RecordNotFound,
+ format!("View:{} is in trash", view_id),
+ ));
}
match folder.views.get_view(&view_id) {
- None => Err(FlowyError::record_not_found()),
+ None => {
+ error!("Can't find the view with id: {}", view_id);
+ Err(FlowyError::record_not_found())
+ },
Some(view) => {
let child_views = folder
.views