mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: wasm build (#4412)
* chore: enable wasm build * chore: bump collab * chore: fix build * chore: flowy-document wasm * chore: fix compile * chore: fix compile * chore: fix compile * chore: fix compile * chore: fix ci * chore: fix ci * chore: fix ci
This commit is contained in:
@ -1,25 +1,36 @@
|
||||
#[cfg(feature = "impl_from_collab_database")]
|
||||
use collab_database::error::DatabaseError;
|
||||
|
||||
#[cfg(feature = "impl_from_collab_document")]
|
||||
use collab_document::error::DocumentError;
|
||||
|
||||
#[cfg(feature = "impl_from_collab_document")]
|
||||
use collab_plugins::local_storage::kv::PersistenceError;
|
||||
|
||||
use crate::{ErrorCode, FlowyError};
|
||||
|
||||
#[cfg(feature = "impl_from_collab_document")]
|
||||
impl From<PersistenceError> for FlowyError {
|
||||
fn from(err: PersistenceError) -> Self {
|
||||
match err {
|
||||
PersistenceError::UnexpectedEmptyUpdates => FlowyError::new(ErrorCode::RecordNotFound, err),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
PersistenceError::RocksdbCorruption(_) => FlowyError::new(ErrorCode::RocksdbCorruption, err),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
PersistenceError::RocksdbIOError(_) => FlowyError::new(ErrorCode::RocksdbIOError, err),
|
||||
_ => FlowyError::new(ErrorCode::RocksdbInternal, err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "impl_from_collab_database")]
|
||||
impl From<DatabaseError> for FlowyError {
|
||||
fn from(error: DatabaseError) -> Self {
|
||||
FlowyError::internal().with_context(error)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "impl_from_collab_document")]
|
||||
impl From<DocumentError> for FlowyError {
|
||||
fn from(error: DocumentError) -> Self {
|
||||
FlowyError::internal().with_context(error)
|
||||
|
@ -13,12 +13,9 @@ pub mod reqwest;
|
||||
#[cfg(feature = "impl_from_sqlite")]
|
||||
pub mod database;
|
||||
|
||||
#[cfg(feature = "impl_from_collab")]
|
||||
#[cfg(feature = "impl_from_collab_document")]
|
||||
pub mod collab;
|
||||
|
||||
#[cfg(feature = "impl_from_postgres")]
|
||||
mod postgres;
|
||||
|
||||
#[cfg(feature = "impl_from_appflowy_cloud")]
|
||||
mod cloud;
|
||||
#[cfg(feature = "impl_from_url")]
|
||||
|
@ -1,7 +0,0 @@
|
||||
use crate::FlowyError;
|
||||
|
||||
impl std::convert::From<tokio_postgres::Error> for FlowyError {
|
||||
fn from(error: tokio_postgres::Error) -> Self {
|
||||
FlowyError::internal().with_context(error)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user