Defines the shared Error enum for the domain crate, covering tool-call failures, JSON repair errors, and provider/workspace identifiers. Reuse when adding new domain-level error variants with thiserror.
// Source: https://github.com/tailcallhq/forgecode | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use std::pin::Pin;
use derive_more::From;
use forge_json_repair::JsonRepairError;
use thiserror::Error;
use crate::{AgentId, ConversationId, ProviderId, WorkspaceId};
// NOTE: Deriving From for error is a really bad idea. This is because you end
// up converting errors incorrectly without much context. For eg: You don't want
// all serde error to be treated as the same. Instead we want to know exactly
// where that serde failure happened and for what kind of value.
#[derive(Debug, Error, From)]
pub enum Error {
#[error("Missing tool name")]
ToolCallMissingName,
#[erro
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key