Refactor plugin manager and gRPC server (#96)

This commit is contained in:
Gregory Schier
2024-09-19 05:58:12 -07:00
committed by GitHub
parent 844d795014
commit a3b64423fd
27 changed files with 661 additions and 614 deletions

View File

@@ -5,22 +5,35 @@ use crate::server::plugin_runtime::EventStreamEvent;
#[derive(Error, Debug)]
pub enum Error {
#[error("IO error")]
#[error("IO error: {0}")]
IoErr(#[from] io::Error),
#[error("Tauri error")]
#[error("Tauri error: {0}")]
TauriErr(#[from] tauri::Error),
#[error("Tauri shell error")]
#[error("Tauri shell error: {0}")]
TauriShellErr(#[from] tauri_plugin_shell::Error),
#[error("Grpc transport error")]
#[error("Grpc transport error: {0}")]
GrpcTransportErr(#[from] tonic::transport::Error),
#[error("Grpc send error")]
#[error("Grpc send error: {0}")]
GrpcSendErr(#[from] SendError<tonic::Result<EventStreamEvent>>),
#[error("JSON error")]
#[error("JSON error: {0}")]
JsonErr(#[from] serde_json::Error),
#[error("Plugin not found: {0}")]
PluginNotFoundErr(String),
#[error("Plugin error: {0}")]
PluginErr(String),
#[error("Client not initialized error")]
ClientNotInitializedErr,
#[error("Unknown event received")]
UnknownEventErr,
}
impl Into<String> for Error {