mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
- Move auth-owned source and tests into `auth` as a standalone workspace crate. - Move `create_client` into `codex-client` and import it directly where needed. Co-authored-by: Codex <noreply@openai.com>
26 lines
542 B
Rust
26 lines
542 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Error)]
|
|
#[error("{message}")]
|
|
pub struct RefreshTokenFailedError {
|
|
pub reason: RefreshTokenFailedReason,
|
|
pub message: String,
|
|
}
|
|
|
|
impl RefreshTokenFailedError {
|
|
pub fn new(reason: RefreshTokenFailedReason, message: impl Into<String>) -> Self {
|
|
Self {
|
|
reason,
|
|
message: message.into(),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum RefreshTokenFailedReason {
|
|
Expired,
|
|
Exhausted,
|
|
Revoked,
|
|
Other,
|
|
}
|