11 lines
340 B
Rust
Raw Normal View History

2023-01-30 11:11:19 +08:00
use crate::FlowyError;
use bytes::Bytes;
use lib_dispatch::prelude::{AFPluginEventResponse, ResponseBuilder};
use std::convert::TryInto;
impl lib_dispatch::Error for FlowyError {
fn as_response(&self) -> AFPluginEventResponse {
let bytes: Bytes = self.clone().try_into().unwrap();
ResponseBuilder::Err().data(bytes).build()
}
2023-01-30 11:11:19 +08:00
}