File tree 3 files changed +6
-5
lines changed
examples/cli-app-with-awc
3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ tokio = { version = "1.27.0", features = ["full"] }
18
18
yaup = " 0.2.0"
19
19
tokio-util = { version = " 0.7.10" , features = [" full" ] }
20
20
actix-rt = " 2.9.0"
21
+ anyhow = " 1.0.82"
Original file line number Diff line number Diff line change @@ -59,23 +59,23 @@ impl HttpClient for AwcClient {
59
59
. content_type ( content_type)
60
60
. send_stream ( stream)
61
61
. await
62
- . map_err ( |err| Error :: Other ( Box :: new ( err) ) ) ?
62
+ . map_err ( |err| Error :: Other ( anyhow :: anyhow! ( err. to_string ( ) ) . into ( ) ) ) ?
63
63
} else {
64
64
request
65
65
. send ( )
66
66
. await
67
- . map_err ( |err| Error :: Other ( Box :: new ( err) ) ) ?
67
+ . map_err ( |err| Error :: Other ( anyhow :: anyhow! ( err. to_string ( ) ) . into ( ) ) ) ?
68
68
} ;
69
69
70
70
let status = response. status ( ) . as_u16 ( ) ;
71
71
let mut body = String :: from_utf8 (
72
72
response
73
73
. body ( )
74
74
. await
75
- . map_err ( |err| Error :: Other ( Box :: new ( err) ) ) ?
75
+ . map_err ( |err| Error :: Other ( anyhow :: anyhow! ( err. to_string ( ) ) . into ( ) ) ) ?
76
76
. to_vec ( ) ,
77
77
)
78
- . map_err ( |err| Error :: Other ( Box :: new ( err) ) ) ?;
78
+ . map_err ( |err| Error :: Other ( anyhow :: anyhow! ( err. to_string ( ) ) . into ( ) ) ) ?;
79
79
80
80
if body. is_empty ( ) {
81
81
body = "null" . to_string ( ) ;
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ pub enum Error {
62
62
InvalidUuid4Version ,
63
63
64
64
#[ error( transparent) ]
65
- Other ( Box < dyn std:: error:: Error > ) ,
65
+ Other ( Box < dyn std:: error:: Error + Send + Sync + ' static > ) ,
66
66
}
67
67
68
68
#[ derive( Debug , Clone , Deserialize , Error ) ]
You can’t perform that action at this time.
0 commit comments