pub enum CopilotError {
Http(Error),
Body(BodyError),
Stream(ParseError),
Json(Error),
Api(String),
AuthorizationPending,
DeviceCodeExpired,
AccessDenied,
RateLimit {
message: String,
retry_after: Option<Duration>,
},
ServerError {
status: u16,
message: String,
},
Timeout,
}Expand description
Errors that can arise when calling the GitHub Copilot API.
Variants§
Http(Error)
HTTP layer errors from zenwave.
Body(BodyError)
Response body parsing failures.
Stream(ParseError)
SSE parsing failures.
Json(Error)
JSON serialization/deserialization errors.
Api(String)
API contract violations or unsupported operations.
AuthorizationPending
OAuth authorization pending (user hasn’t completed flow yet).
DeviceCodeExpired
OAuth device code expired.
AccessDenied
OAuth access denied by user.
RateLimit
Rate limit exceeded (HTTP 429).
Fields
ServerError
Server error (HTTP 5xx).
Timeout
Request timed out.
Implementations§
Trait Implementations§
Source§impl Debug for CopilotError
impl Debug for CopilotError
Source§impl Display for CopilotError
impl Display for CopilotError
Source§impl Error for CopilotError
impl Error for CopilotError
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 CopilotError
impl From<Error> for CopilotError
Source§impl From<Error> for CopilotError
impl From<Error> for CopilotError
Source§impl From<Error> for CopilotError
impl From<Error> for CopilotError
Source§impl From<ParseError> for CopilotError
impl From<ParseError> for CopilotError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for CopilotError
impl !UnwindSafe for CopilotError
impl Forget for CopilotError
impl Freeze for CopilotError
impl Send for CopilotError
impl Sync for CopilotError
impl Unpin for CopilotError
impl UnsafeUnpin for CopilotError
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