From 4e07f4f0aa72ddb76bd317000a3c82f6bffad2ac Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Mon, 16 Oct 2023 05:24:58 -0500 Subject: [PATCH] core/services/keystore: *memoryORM.saveEncryptedKeyRing - handle callback errors (#10958) --- core/services/keystore/keystoretest.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/services/keystore/keystoretest.go b/core/services/keystore/keystoretest.go index 7e0280f974a..0b5ce4e0057 100644 --- a/core/services/keystore/keystoretest.go +++ b/core/services/keystore/keystoretest.go @@ -1,6 +1,7 @@ package keystore import ( + "errors" "sync" "github.com/smartcontractkit/sqlx" @@ -26,14 +27,14 @@ func (o *memoryORM) isEmpty() (bool, error) { return false, nil } -func (o *memoryORM) saveEncryptedKeyRing(kr *encryptedKeyRing, callbacks ...func(pg.Queryer) error) error { +func (o *memoryORM) saveEncryptedKeyRing(kr *encryptedKeyRing, callbacks ...func(pg.Queryer) error) (err error) { o.mu.Lock() defer o.mu.Unlock() o.keyRing = kr for _, c := range callbacks { - c(o.q) + err = errors.Join(err, c(o.q)) } - return nil + return } func (o *memoryORM) getEncryptedKeyRing() (encryptedKeyRing, error) {