Skip to main content

pcs_external/
error.rs

1/// Errors from the PCS External API client.
2#[derive(Debug, thiserror::Error)]
3#[non_exhaustive]
4pub enum Error {
5    /// Connection or transport error.
6    #[error("External API error: {0}")]
7    External(String),
8
9    /// API key contains characters that are not valid HTTP header values
10    /// (CR, LF, NUL, non-visible ASCII). Strip control characters and
11    /// retry; do not log the raw key.
12    #[error("API key is not a valid HTTP header value")]
13    InvalidApiKey,
14
15    /// The configured path prefix could not be combined with a request URI.
16    /// Indicates a malformed prefix at `connect()` time. Caught at
17    /// `connect()` so it cannot reach `Service::call`.
18    #[error("Invalid path prefix '{prefix}': {reason}")]
19    InvalidPathPrefix { prefix: String, reason: String },
20}