test: Af cloud workspace member (#3779)

* chore: implement workspace memeber events

* chore: add workspace member test

* chore: fix fmt
This commit is contained in:
Nathan.fooo
2023-10-25 21:35:47 +08:00
committed by GitHub
parent ad21a61ffb
commit 48582cb718
28 changed files with 620 additions and 262 deletions

View File

@ -3,6 +3,7 @@ use std::fmt::Debug;
use protobuf::ProtobufError;
use thiserror::Error;
use validator::{ValidationError, ValidationErrors};
use flowy_derive::ProtoBuf;
@ -132,6 +133,18 @@ impl std::convert::From<protobuf::ProtobufError> for FlowyError {
}
}
impl From<ValidationError> for FlowyError {
fn from(value: ValidationError) -> Self {
FlowyError::new(ErrorCode::InvalidParams, value)
}
}
impl From<ValidationErrors> for FlowyError {
fn from(value: ValidationErrors) -> Self {
FlowyError::new(ErrorCode::InvalidParams, value)
}
}
impl From<anyhow::Error> for FlowyError {
fn from(e: anyhow::Error) -> Self {
e.downcast::<FlowyError>()