mirror of https://github.com/tikv/client-rust.git
feat: ExtractError also checks region_error
Signed-off-by: ekexium <ekexium@gmail.com>
This commit is contained in:
parent
cc1bbb7c60
commit
e828f9135d
|
@ -265,7 +265,7 @@ impl<P: Plan> Clone for ExtractError<P> {
|
|||
/// returns an `Err` wrapping the error.
|
||||
///
|
||||
/// The errors come from two places: `Err` from inner plans, and `Ok(response)`
|
||||
/// where `response` contains unresolved errors.
|
||||
/// where `response` contains unresolved errors (`error` and `region_error`).
|
||||
#[async_trait]
|
||||
impl<P: Plan> Plan for ExtractError<P>
|
||||
where
|
||||
|
@ -277,6 +277,8 @@ where
|
|||
let mut result = self.inner.execute().await?;
|
||||
if let Some(error) = result.error() {
|
||||
Err(error)
|
||||
} else if let Some(error) = result.region_error() {
|
||||
Err(error)
|
||||
} else {
|
||||
Ok(result)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue