pub enum OpenCodeError {
Http(Error),
Json(Error),
Packaging(String),
Io(Error),
ServiceError {
status: u16,
message: String,
},
IndexNotFound(String),
IndexPending(String),
IndexingTimeout,
InvalidConfig(String),
NoResults(String),
FileNotFound(String),
}Expand description
Errors that can occur when communicating with OpenCode
Variants§
Http(Error)
HTTP request failed
Json(Error)
Failed to serialize/deserialize JSON
Packaging(String)
Failed to package codebase
Io(Error)
IO error during file operations
ServiceError
OpenCode service returned an error
IndexNotFound(String)
Index not found
IndexPending(String)
Index is still processing
IndexingTimeout
Timeout waiting for indexing
InvalidConfig(String)
Invalid configuration
NoResults(String)
Search returned no results
FileNotFound(String)
File not found in index
Implementations§
Source§impl OpenCodeError
impl OpenCodeError
Sourcepub fn service_error(status: u16, message: impl Into<String>) -> Self
pub fn service_error(status: u16, message: impl Into<String>) -> Self
Create a service error from status code and message
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable
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
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.