pub enum VsCodeError {
ClientInit(String),
ProxyUnavailable(String),
Network(String),
Authentication(String),
RateLimited,
InvalidRequest(String),
ServiceUnavailable,
ApiError(String),
Decode(String),
Stream(String),
}Expand description
VSCode Copilot provider errors.
Variants§
ClientInit(String)
Failed to initialize HTTP client.
Proxy server is unavailable or not responding.
Network(String)
Network communication error.
Authentication(String)
Authentication or authorization failed.
RateLimited
Rate limit exceeded.
InvalidRequest(String)
Invalid request format or parameters.
Service temporarily unavailable.
ApiError(String)
Generic API error.
Decode(String)
Failed to decode response.
Stream(String)
Streaming error.
Implementations§
Source§impl VsCodeError
impl VsCodeError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if this error is retryable.
§WHY
Consumers of this API need to know which errors warrant retry attempts versus which errors indicate permanent failures. This method encapsulates that knowledge so callers don’t need to match on error variants.
§Retryable Errors
Network: Temporary connectivity issues (DNS, timeout, connection refused)RateLimited: 429 response - will succeed after backoffServiceUnavailable: 503 response - server temporarily down
§Non-Retryable Errors
ClientInit: Configuration issue - won’t resolve with retryProxyUnavailable: Proxy needs to be startedAuthentication: Token invalid - need new tokenInvalidRequest: Request parameters wrong - fix before retryApiError: Permanent server-side failureDecode: Response format issue - server bug or version mismatchStream: SSE parsing error - unlikely to resolve
§Example
use edgequake_llm::providers::vscode::VsCodeError;
let err = VsCodeError::RateLimited;
if err.is_retryable() {
// Apply exponential backoff and retry
}Trait Implementations§
Source§impl Debug for VsCodeError
impl Debug for VsCodeError
Source§impl Display for VsCodeError
impl Display for VsCodeError
Source§impl Error for VsCodeError
impl Error for VsCodeError
1.30.0 · 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<VsCodeError> for LlmError
impl From<VsCodeError> for LlmError
Source§fn from(err: VsCodeError) -> Self
fn from(err: VsCodeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for VsCodeError
impl RefUnwindSafe for VsCodeError
impl Send for VsCodeError
impl Sync for VsCodeError
impl Unpin for VsCodeError
impl UnsafeUnpin for VsCodeError
impl UnwindSafe for VsCodeError
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> 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.