Common Errors

SynwireError variants

Model errors

ErrorCauseResolution
ModelError::RateLimitAPI rate limit exceededWait for retry_after duration, or use RunnableRetry
ModelError::AuthenticationFailedInvalid or missing API keyCheck OPENAI_API_KEY or equivalent
ModelError::InvalidRequestMalformed requestCheck message format and model parameters
ModelError::ContentFilteredContent safety filter triggeredModify input content
ModelError::TimeoutRequest timed outIncrease timeout or retry
ModelError::ConnectionNetwork connectivity issueCheck network, retry

Tool errors

ErrorCauseResolution
ToolError::NotFoundTool name not registeredCheck tool name spelling
ToolError::InvalidNameName does not match [a-zA-Z0-9_-]{1,64}Fix tool name
ToolError::ValidationFailedInput does not match schemaCheck tool call arguments
ToolError::InvocationFailedTool execution failedCheck tool implementation
ToolError::PathTraversalPath traversal attempt detectedSecurity check -- do not bypass
ToolError::TimeoutTool execution timed outIncrease timeout

Parse errors

ErrorCauseResolution
ParseError::ParseFailedCould not parse model outputCheck output format, add format instructions
ParseError::FormatMismatchOutput does not match expected formatImprove prompt or use structured output

Embedding errors

ErrorCauseResolution
EmbeddingError::FailedEmbedding API call failedCheck API key and model name
EmbeddingError::DimensionMismatchVector dimensions do not matchEnsure consistent embedding model

Vector store errors

ErrorCauseResolution
VectorStoreError::NotFoundDocument ID not foundCheck document was added
VectorStoreError::DimensionMismatchEmbedding dimensions mismatchUse same embedding model for add and query

Other

ErrorCause
SynwireError::PromptPrompt template variable missing or invalid
SynwireError::CredentialCredential provider failed
SynwireError::SerializationJSON serialisation/deserialisation failed
SynwireError::IoFile system or I/O error

GraphError variants

ErrorCauseResolution
RecursionLimitExceeded step limitIncrease limit or fix loop
NoEntryPointset_entry_point not calledCall graph.set_entry_point("node")
DuplicateNodeTwo nodes with same nameUse unique names
TaskNotFoundEdge references unknown nodeCheck node names
CompileErrorNode has no outgoing edgesAdd edges for all nodes
EmptyInputEmpty state providedProvide initial state
InterruptGraph paused for human inputHandle interrupt, resume later
MultipleValuesLastValue channel got >1 valueUse Topic channel or fix graph

Error kind matching

Use SynwireErrorKind for retry and fallback decisions:

use synwire_core::error::SynwireErrorKind;

match err.kind() {
    SynwireErrorKind::Model => { /* retry */ }
    SynwireErrorKind::Parse => { /* re-prompt */ }
    SynwireErrorKind::Credential => { /* fail fast */ }
    _ => { /* handle other */ }
}