aws_smithy_http_client/
error.rs

1/*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5use aws_smithy_runtime_api::box_error::BoxError;
6use std::fmt;
7
8/// HTTP client errors
9///
10/// This is normally due to configuration issues, internal SDK bugs, or other user error.
11#[derive(Debug)]
12pub struct HttpClientError {
13    source: Option<BoxError>,
14}
15
16impl fmt::Display for HttpClientError {
17    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18        write!(f, "unknown HTTP client error")
19    }
20}
21
22impl std::error::Error for HttpClientError {
23    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
24        self.source.as_ref().map(|err| err.as_ref() as _)
25    }
26}