Skip to content

Commit 6a7d2f5

Browse files
feat(Common): Add TreeView error and StatusBar proxy target
- Added `Serialize` and `Deserialize` to `CommonError` to enable IPC transmission of errors across `Mountain`↔`Cocoon` boundaries via `Vine` gRPC layer, ensuring structured error handling in extension workflows - Introduced `TreeViewProviderNotFound` error variant to support TreeView API implementation in `Cocoon` sidecar (MVP Path A), aligning with implemented workflow #11 - Added `ExtHostStatusBar` variant to `ProxyTarget` enum to enable RPC routing for Status Bar API through `Track` dispatcher, extending extension host capabilities - Simplified `tauri::Error` conversion to maintain clean error handling in Tauri↔`Wind` IPC (`Echo` layer) These changes expand extension API support in `Cocoon` while strengthening error propagation mechanisms in Land's core IPC architecture.
1 parent e77aca8 commit 6a7d2f5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Source/Error/CommonError.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
66
use std::path::PathBuf;
77

8+
use serde::{Deserialize, Serialize};
89
use thiserror::Error;
910

1011
/// A common error enum for the application, encompassing all major categories
1112
/// of failures that can occur during the execution of effects or other
12-
/// operations.
13-
#[derive(Error, Debug, Clone)]
13+
// operations.
14+
#[derive(Error, Debug, Clone, Serialize, Deserialize)]
1415
pub enum CommonError {
1516
// --- FileSystem Errors ---
1617
#[error("FileSystem I/O error for '{Path}': {Description}")]
@@ -65,6 +66,10 @@ pub enum CommonError {
6566
#[error("Language provider '{ProviderIdentifier}' invocation failed: {Reason}")]
6667
ProviderInvocation { ProviderIdentifier:String, Reason:String },
6768

69+
// --- TreeView Errors (New) ---
70+
#[error("TreeView provider not found for view ID '{ViewIdentifier}'")]
71+
TreeViewProviderNotFound { ViewIdentifier:String },
72+
6873
// --- Other Specific Errors ---
6974
#[error("External service '{ServiceName}' failed: {Description}")]
7075
ExternalServiceError { ServiceName:String, Description:String },
@@ -120,9 +125,5 @@ impl From<serde_json::Error> for CommonError {
120125
/// Converts a `tauri::Error` into a `CommonError`. This is useful for
121126
/// handling errors from Tauri's APIs within our effect system.
122127
impl From<tauri::Error> for CommonError {
123-
fn from(TauriError:tauri::Error) -> Self {
124-
// We can categorize some Tauri errors, but for now, a general
125-
// UserInterfaceInteraction or IPC error is sufficient.
126-
CommonError::UserInterfaceInteraction { Reason:TauriError.to_string() }
127-
}
128+
fn from(TauriError:tauri::Error) -> Self { CommonError::UserInterfaceInteraction { Reason:TauriError.to_string() } }
128129
}

Source/IPC/DTO/ProxyTarget.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ pub enum ProxyTarget {
110110

111111
ExtHostTreeView,
112112

113+
ExtHostStatusBar,
114+
113115
ExtHostSourceControlManagement,
114116

115117
ExtHostTesting,
@@ -118,7 +120,6 @@ pub enum ProxyTarget {
118120
impl ProxyTarget {
119121
/// Returns a string prefix representing the target, used in constructing
120122
/// fully qualified RPC method names (e.g.,
121-
122123
/// `MainThreadCommands$ExecuteCommand`).
123124
pub fn GetTargetPrefix(&self) -> String { format!("{:?}", self) }
124125
}

0 commit comments

Comments
 (0)