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

This commit is contained in:
ok32 authored and Michal Jan Matczuk committed 2021-05-04 10:57:09 +02:00
1 parent d123214401
commit 01be91c745
1 file changed
+4
+4
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