Public declaration syntax from forge-rs/crates/forge-flowers/src/error.rs Original source SHA-256: 8a0824146ba62f3b4a11865223ec855e0b6b90657285c6d0a6d4284301b23f30 Function bodies and constant values are omitted. This is not the complete implementation. Source line 18 #[derive(Debug, Error)] pub enum ForgeBridgeError { /// The bridge failed to create a Forge agent via the factory. /// /// This typically indicates a misconfiguration: the factory could not /// construct an agent with the given journaled provider and tool registry. #[error("handler creation failed for agent '{agent_name}': {reason}")] HandlerCreationFailed { /// The agent name that was being constructed. agent_name: String, /// Why construction failed. reason: String, }, /// A Brew node failed during execution within the workflow handler. /// /// Contains the node ID so the caller can identify which step in the /// Brew plan caused the failure. #[error("node '{node_id}' execution failed: {reason}")] NodeExecutionFailed { /// The node that failed. node_id: String, /// Why execution failed. reason: String, }, /// The bridge could not map a `ResolvedBrewPlan` to a Flowers workflow. /// /// This indicates a structural problem with the plan: missing entry nodes, /// empty execution order, or an invalid graph topology. #[error("plan mapping failed for brew '{brew_id}': {reason}")] PlanMappingFailed { /// The brew ID of the plan that could not be mapped. brew_id: String, /// Why the mapping failed. reason: String, }, /// During replay, the bridge detected that the input to a journaled call /// does not match the cached input from the original execution. /// /// This is a hard error by default (fail closed). The execution must be /// cancelled and restarted if the agent's inputs have changed. #[error("replay input mismatch at interface '{interface}' method '{method}': {reason}")] ReplayInputMismatch { /// The WIT interface of the mismatched call. interface: String, /// The method of the mismatched call. method: String, /// Description of what differed. reason: String, }, /// The bridge encountered a `ResolvedNodeKind` that it does not know how /// to execute in the current version. #[error("unsupported node kind '{kind}' in node '{node_id}': {reason}")] UnsupportedNodeKind { /// The node ID containing the unsupported kind. node_id: String, /// The kind name that is not supported. kind: String, /// Additional context. reason: String, }, /// An error propagated from the Flowers runtime. #[cfg(not(target_arch = "wasm32"))] #[error("flowers runtime error: {0}")] Flowers(#[from] flowers::FlowersError), /// A serialization or deserialization error during bridging. #[error("serialization error in bridge: {0}")] Serialization(#[from] serde_json::Error), /// An error propagated from the Forge agent layer. #[error("forge agent error: {0}")] ForgeAgent(String), } Source line 97 pub type ForgeBridgeResult = Result;