pub enum OpenCodeError {
Show 14 variants
CliNotFound(String),
CliExecution(String),
CliExitError {
code: i32,
stderr: String,
},
Timeout(u64),
OutputParse(String),
Json(Error),
Io(Error),
InvalidConfig(String),
McpError(String),
AuthRequired,
NoResults(String),
RateLimited,
ModelUnavailable(String),
FileCollection(String),
}Expand description
Errors that can occur when using OpenCode CLI
Variants§
CliNotFound(String)
OpenCode CLI binary not found
CliExecution(String)
CLI execution failed
CliExitError
CLI returned non-zero exit code
Timeout(u64)
CLI timed out
OutputParse(String)
Failed to parse CLI output
Json(Error)
Failed to serialize/deserialize JSON
Io(Error)
IO error during file operations
InvalidConfig(String)
Invalid configuration
McpError(String)
MCP server error
AuthRequired
Authentication required
NoResults(String)
No results found
RateLimited
Rate limit exceeded
Model not available
FileCollection(String)
File collection error
Implementations§
Source§impl OpenCodeError
impl OpenCodeError
Sourcepub fn exit_error(code: i32, stderr: impl Into<String>) -> Self
pub fn exit_error(code: i32, stderr: impl Into<String>) -> Self
Create a CLI exit error
Sourcepub fn parse_error(message: impl Into<String>) -> Self
pub fn parse_error(message: impl Into<String>) -> Self
Create a parse error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable
Sourcepub fn needs_auth(&self) -> bool
pub fn needs_auth(&self) -> bool
Check if error requires authentication
Sourcepub fn is_config_error(&self) -> bool
pub fn is_config_error(&self) -> bool
Check if this is a configuration error
Trait Implementations§
Source§impl Debug for OpenCodeError
impl Debug for OpenCodeError
Source§impl Display for OpenCodeError
impl Display for OpenCodeError
Source§impl Error for OpenCodeError
impl Error for OpenCodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for OpenCodeError
impl From<Error> for OpenCodeError
Auto Trait Implementations§
impl Freeze for OpenCodeError
impl !RefUnwindSafe for OpenCodeError
impl Send for OpenCodeError
impl Sync for OpenCodeError
impl Unpin for OpenCodeError
impl !UnwindSafe for OpenCodeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more