GetCAS: check if the query has a build error before trying to execute it

This commit is contained in:
ok32
2021-04-30 21:17:32 +03:00
committed by Michal Jan Matczuk
parent d123214401
commit 01be91c745

View File

@@ -265,6 +265,10 @@ func (q *Queryx) GetRelease(dest interface{}) error {
// the previous values will be stored in dest object.
// See: https://docs.scylladb.com/using-scylla/lwt/ for more details.
func (q *Queryx) GetCAS(dest interface{}) (applied bool, err error) {
if q.err != nil {
return false, q.err
}
iter := q.Iter()
if err := iter.Get(dest); err != nil {
return false, err