Skip to content

Commit d568c4a

Browse files
committed
libsql: improve hrana api error message
1 parent 9241b00 commit d568c4a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libsql/src/hrana/hyper.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ impl HttpSender {
5252

5353
let resp = self.inner.request(req).await.map_err(HranaError::from)?;
5454

55-
if resp.status() != StatusCode::OK {
55+
let status = resp.status();
56+
if status != StatusCode::OK {
5657
let body = hyper::body::to_bytes(resp.into_body())
5758
.await
5859
.map_err(HranaError::from)?;
5960
let body = String::from_utf8(body.into()).unwrap();
60-
return Err(HranaError::Api(body));
61+
return Err(HranaError::Api(format!("status={}, body={}", status, body)));
6162
}
6263

6364
let body: super::HttpBody<ByteStream> = if resp.is_end_stream() {

0 commit comments

Comments
 (0)