diff --git a/lib/src/dbs/channel.rs b/lib/src/dbs/channel.rs index 70a20c68..5c85eaba 100644 --- a/lib/src/dbs/channel.rs +++ b/lib/src/dbs/channel.rs @@ -21,12 +21,14 @@ impl Value { txn: Transaction, chn: UnboundedSender<(Option, Value)>, ) -> Result<(), Error> { - match self { - Value::Array(v) => v.process(&ctx, &opt, &txn, &chn).await?, - Value::Model(v) => v.process(&ctx, &opt, &txn, &chn).await?, - Value::Thing(v) => v.process(&ctx, &opt, &txn, &chn).await?, - Value::Table(v) => v.process(&ctx, &opt, &txn, &chn).await?, - v => chn.send((None, v))?, + if ctx.is_ok() { + match self { + Value::Array(v) => v.process(&ctx, &opt, &txn, &chn).await?, + Value::Model(v) => v.process(&ctx, &opt, &txn, &chn).await?, + Value::Thing(v) => v.process(&ctx, &opt, &txn, &chn).await?, + Value::Table(v) => v.process(&ctx, &opt, &txn, &chn).await?, + v => chn.send((None, v))?, + } } Ok(()) } @@ -42,12 +44,14 @@ impl Array { chn: &UnboundedSender<(Option, Value)>, ) -> Result<(), Error> { for v in self.value.into_iter() { - match v { - Value::Array(v) => v.process(ctx, opt, txn, chn).await?, - Value::Model(v) => v.process(ctx, opt, txn, chn).await?, - Value::Thing(v) => v.process(ctx, opt, txn, chn).await?, - Value::Table(v) => v.process(ctx, opt, txn, chn).await?, - v => chn.send((None, v))?, + if ctx.is_ok() { + match v { + Value::Array(v) => v.process(ctx, opt, txn, chn).await?, + Value::Model(v) => v.process(ctx, opt, txn, chn).await?, + Value::Thing(v) => v.process(ctx, opt, txn, chn).await?, + Value::Table(v) => v.process(ctx, opt, txn, chn).await?, + v => chn.send((None, v))?, + } } } Ok(()) diff --git a/lib/src/dbs/iterate.rs b/lib/src/dbs/iterate.rs index c8fe4138..a10ca462 100644 --- a/lib/src/dbs/iterate.rs +++ b/lib/src/dbs/iterate.rs @@ -23,12 +23,14 @@ impl Value { txn: &Transaction, ite: &mut Iterator<'_>, ) -> Result<(), Error> { - match self { - Value::Array(v) => v.iterate(ctx, opt, txn, ite).await?, - Value::Model(v) => v.iterate(ctx, opt, txn, ite).await?, - Value::Thing(v) => v.iterate(ctx, opt, txn, ite).await?, - Value::Table(v) => v.iterate(ctx, opt, txn, ite).await?, - v => ite.process(ctx, opt, txn, None, v).await, + if ctx.is_ok() { + match self { + Value::Array(v) => v.iterate(ctx, opt, txn, ite).await?, + Value::Model(v) => v.iterate(ctx, opt, txn, ite).await?, + Value::Thing(v) => v.iterate(ctx, opt, txn, ite).await?, + Value::Table(v) => v.iterate(ctx, opt, txn, ite).await?, + v => ite.process(ctx, opt, txn, None, v).await, + } } Ok(()) } @@ -45,12 +47,14 @@ impl Array { ite: &mut Iterator<'_>, ) -> Result<(), Error> { for v in self.value.into_iter() { - match v { - Value::Array(v) => v.iterate(ctx, opt, txn, ite).await?, - Value::Model(v) => v.iterate(ctx, opt, txn, ite).await?, - Value::Thing(v) => v.iterate(ctx, opt, txn, ite).await?, - Value::Table(v) => v.iterate(ctx, opt, txn, ite).await?, - v => ite.process(ctx, opt, txn, None, v).await, + if ctx.is_ok() { + match v { + Value::Array(v) => v.iterate(ctx, opt, txn, ite).await?, + Value::Model(v) => v.iterate(ctx, opt, txn, ite).await?, + Value::Thing(v) => v.iterate(ctx, opt, txn, ite).await?, + Value::Table(v) => v.iterate(ctx, opt, txn, ite).await?, + v => ite.process(ctx, opt, txn, None, v).await, + } } } Ok(())