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:
@ -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