Commit ed391435 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'non-exhaustive-errors'

41868581

 gitlab: add non-exhaustive variants to error types
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !177
parents b0b399e7 41868581
......@@ -36,12 +36,19 @@ const PATH_SEGMENT_ENCODE_SET: &AsciiSet = &CONTROLS
.add(b'/');
#[derive(Debug, Error)]
// TODO #[non_exhaustive]
pub enum TokenError {
#[error("header value error: {}", source)]
HeaderValue {
#[from]
source: header::InvalidHeaderValue,
},
/// This is here to force `_` matching right now.
///
/// **DO NOT USE**
#[doc(hidden)]
#[error("unreachable...")]
_NonExhaustive,
}
type TokenResult<T> = Result<T, TokenError>;
......@@ -81,6 +88,7 @@ impl Token {
}
#[derive(Debug, Error)]
// TODO #[non_exhaustive]
pub enum GitlabError {
#[error("failed to parse url: {}", source)]
UrlParse {
......@@ -114,6 +122,12 @@ pub enum GitlabError {
source: serde_json::Error,
typename: Option<&'static str>,
},
/// This is here to force `_` matching right now.
///
/// **DO NOT USE**
#[doc(hidden)]
#[error("unreachable...")]
_NonExhaustive,
}
impl GitlabError {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment