Skip to content

Commit e0fa04f

Browse files
authored
resp: Fix error propagation (#29)
1 parent 0dfc938 commit e0fa04f

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
All changes in this project will be noted in this file.
44

5+
## 0.8.9
6+
7+
### Additions
8+
9+
- Added enhanced multi-row decode support
10+
- Added deref to slice for rows
11+
12+
### Fixes
13+
14+
- Fixed error propagation in `FromResponse` impls
15+
516
## 0.8.8
617

718
### Fixes

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license = "Apache-2.0"
99
name = "skytable"
1010
readme = "README.md"
1111
repository = "https://github.com/skytable/client-rust"
12-
version = "0.8.8"
12+
version = "0.8.9"
1313

1414
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1515
[dependencies]

src/response.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ impl FromResponse for Row {
329329
fn from_response(resp: Response) -> ClientResult<Self> {
330330
match resp {
331331
Response::Row(r) => Ok(r),
332+
Response::Error(e) => Err(Error::ServerError(e)),
332333
_ => Err(Error::ParseError(ParseError::ResponseMismatch)),
333334
}
334335
}
@@ -338,6 +339,7 @@ impl FromResponse for Vec<Row> {
338339
fn from_response(resp: Response) -> ClientResult<Self> {
339340
match resp {
340341
Response::Rows(rows) => Ok(rows),
342+
Response::Error(e) => Err(Error::ServerError(e)),
341343
_ => Err(Error::ParseError(ParseError::ResponseMismatch)),
342344
}
343345
}
@@ -376,6 +378,7 @@ impl<T: FromRow> FromResponse for Rows<T> {
376378
}
377379
Ok(Self(ret))
378380
}
381+
Response::Error(e) => Err(Error::ServerError(e)),
379382
_ => Err(Error::ParseError(ParseError::ResponseMismatch)),
380383
}
381384
}

0 commit comments

Comments
 (0)