Skip to content

Commit 0285e62

Browse files
Merge branch 'main' into vector-search-embedder
2 parents 8ade09d + 85ceec4 commit 0285e62

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

examples/cli-app-with-awc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ tokio = { version = "1.27.0", features = ["full"] }
1818
yaup = "0.2.0"
1919
tokio-util = { version = "0.7.10", features = ["full"] }
2020
actix-rt = "2.9.0"
21+
anyhow = "1.0.82"

examples/cli-app-with-awc/src/main.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,23 @@ impl HttpClient for AwcClient {
5959
.content_type(content_type)
6060
.send_stream(stream)
6161
.await
62-
.map_err(|err| Error::Other(Box::new(err)))?
62+
.map_err(|err| Error::Other(anyhow::anyhow!(err.to_string()).into()))?
6363
} else {
6464
request
6565
.send()
6666
.await
67-
.map_err(|err| Error::Other(Box::new(err)))?
67+
.map_err(|err| Error::Other(anyhow::anyhow!(err.to_string()).into()))?
6868
};
6969

7070
let status = response.status().as_u16();
7171
let mut body = String::from_utf8(
7272
response
7373
.body()
7474
.await
75-
.map_err(|err| Error::Other(Box::new(err)))?
75+
.map_err(|err| Error::Other(anyhow::anyhow!(err.to_string()).into()))?
7676
.to_vec(),
7777
)
78-
.map_err(|err| Error::Other(Box::new(err)))?;
78+
.map_err(|err| Error::Other(anyhow::anyhow!(err.to_string()).into()))?;
7979

8080
if body.is_empty() {
8181
body = "null".to_string();

src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub enum Error {
6262
InvalidUuid4Version,
6363

6464
#[error(transparent)]
65-
Other(Box<dyn std::error::Error>),
65+
Other(Box<dyn std::error::Error + Send + Sync + 'static>),
6666
}
6767

6868
#[derive(Debug, Clone, Deserialize, Error)]

0 commit comments

Comments
 (0)