File size: 1,875 Bytes
d90101d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/// Authentication flow errors.
use std::time::Duration;

/// Errors that can occur during authentication flows.
#[derive(Debug, Clone, thiserror::Error)]
pub enum Error {
    /// Authentication initiation failed.
    #[error("Authentication initiation failed: {0}")]
    InitiationFailed(String),

    /// Authentication timed out waiting for user.
    #[error("Authentication timed out after {0:?}")]
    Timeout(Duration),

    /// Device code or session expired before completion.
    #[error("Device code or session expired")]
    Expired,

    /// User denied authorization request.
    #[error("User denied authorization")]
    Denied,

    /// Polling operation failed due to network or server error.
    #[error("Polling failed: {0}")]
    PollFailed(String),

    /// Authentication completion failed.
    #[error("Authentication completion failed: {0}")]
    CompletionFailed(String),

    /// Token refresh operation failed.
    #[error("Token refresh failed: {0}")]
    RefreshFailed(String),

    /// Credential validation failed.
    #[error("Credential validation failed: {0}")]
    ValidationFailed(String),

    /// Required parameter is missing.
    #[error("Missing required parameter: {0}")]
    MissingParameter(String),

    /// Parameter value is invalid.
    #[error("Invalid parameter value for '{0}': {1}")]
    InvalidParameter(String, String),

    /// Base URL is invalid or malformed.
    #[error("Invalid base URL: {0}")]
    InvalidBaseUrl(String),

    /// Custom provider validation failed.
    #[error("Custom provider validation failed: {0}")]
    CustomProviderValidationFailed(String),

    /// Invalid authentication context for the flow type.
    #[error("Invalid context: {0}")]
    InvalidContext(String),

    /// No valid source files found to index.
    #[error("No valid source files found to index")]
    NoSourceFilesFound,
}