feat: ExtractError also checks region_error

Signed-off-by: ekexium <ekexium@gmail.com>
This commit is contained in:
ekexium 2021-03-03 12:39:30 +08:00
parent cc1bbb7c60
commit e828f9135d
1 changed files with 3 additions and 1 deletions

View File

@ -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)
}