mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: doc open sync (#4732)
* chore: bump client api * fix: open document and folder * chore: bump collab rev * chore: fix wasm build * chore: fix warnings
This commit is contained in:
@ -30,6 +30,7 @@ url = { version = "2.2", optional = true }
|
||||
collab-database = { version = "0.1.0", optional = true }
|
||||
collab-document = { version = "0.1.0", optional = true }
|
||||
collab-plugins = { version = "0.1.0", optional = true }
|
||||
collab-folder = { version = "0.1.0", optional = true }
|
||||
client-api = { version = "0.1.0", optional = true }
|
||||
|
||||
[features]
|
||||
@ -38,6 +39,7 @@ impl_from_serde = []
|
||||
impl_from_reqwest = ["reqwest"]
|
||||
impl_from_collab_persistence = ["collab-plugins"]
|
||||
impl_from_collab_document = ["collab-document", "impl_from_reqwest", "collab-plugins"]
|
||||
impl_from_collab_folder = ["collab-folder"]
|
||||
impl_from_collab_database= ["collab-database"]
|
||||
impl_from_url = ["url"]
|
||||
|
||||
|
@ -64,6 +64,10 @@ impl FlowyError {
|
||||
self.code == ErrorCode::UserUnauthorized || self.code == ErrorCode::RecordNotFound
|
||||
}
|
||||
|
||||
pub fn is_invalid_data(&self) -> bool {
|
||||
self.code == ErrorCode::InvalidParams
|
||||
}
|
||||
|
||||
pub fn is_local_version_not_support(&self) -> bool {
|
||||
self.code == ErrorCode::LocalVersionNotSupport
|
||||
}
|
||||
|
@ -15,6 +15,22 @@ impl From<DatabaseError> for FlowyError {
|
||||
#[cfg(feature = "impl_from_collab_document")]
|
||||
impl From<DocumentError> for FlowyError {
|
||||
fn from(error: DocumentError) -> Self {
|
||||
FlowyError::internal().with_context(error)
|
||||
match error {
|
||||
DocumentError::NoRequiredData => FlowyError::invalid_data().with_context(error),
|
||||
_ => FlowyError::internal().with_context(error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "impl_from_collab_folder")]
|
||||
use collab_folder::error::FolderError;
|
||||
|
||||
#[cfg(feature = "impl_from_collab_folder")]
|
||||
impl From<FolderError> for FlowyError {
|
||||
fn from(error: FolderError) -> Self {
|
||||
match error {
|
||||
FolderError::NoRequiredData(_) => FlowyError::invalid_data().with_context(error),
|
||||
_ => FlowyError::internal().with_context(error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user