#[non_exhaustive]pub enum Error {
Parse {
message: String,
},
UnsupportedVersion {
found: String,
},
Ref {
reference: String,
at: String,
},
DuplicateName {
name: String,
},
NameTooLong {
name: String,
},
NoBaseUrl,
Fetch {
url: String,
message: String,
},
HttpClient {
source: Box<dyn Error + Send + Sync>,
},
Request {
tool: String,
source: Box<dyn Error + Send + Sync>,
},
Timeout {
tool: String,
},
Cancelled {
tool: String,
},
}Expand description
An error loading an OpenAPI document, building the toolset, or sending a tool’s request.
Loading and building return it directly. A tool call returns it as the source of
ToolError::Execution (Request, Timeout and
Cancelled).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Parse
The text is neither a JSON nor a YAML object, or a file could not be read.
UnsupportedVersion
The document’s openapi field is missing or is not 3.0.x or 3.1.x.
Fields
Ref
A $ref is not local (#/…) or points at nothing.
Fields
DuplicateName
Two operations have the same tool name, or two properties of one tool have the same name
(<tool name>.<property>).
NameTooLong
A prefixed tool name is longer than 64 bytes.
NoBaseUrl
There is no absolute base URL: the server URL is relative, the document was not fetched,
and OpenApiConfig::base_url is not set (or is not an absolute URL). A base URL with a
query or fragment is rejected the same way.
Fetch
Downloading the document failed.
HttpClient
The HTTP client for the tools’ requests could not be built (for example, the TLS backend failed to initialize).
Request
Sending a tool’s request or reading its response failed.
Fields
Timeout
The tool’s request did not finish within OpenApiConfig::timeout.
Cancelled
The invocation was cancelled while the tool’s request was in flight.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()