From ff198834c8a1b96a417739898e8c8da801a960bf Mon Sep 17 00:00:00 2001 From: Michael Street <5597260+MStreet3@users.noreply.github.com> Date: Fri, 22 Nov 2024 10:44:10 +0200 Subject: [PATCH] chore(syncer/orm): fail on get with no rows found --- core/services/workflows/syncer/orm.go | 4 ---- core/services/workflows/syncer/orm_test.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/core/services/workflows/syncer/orm.go b/core/services/workflows/syncer/orm.go index a33a0911ecb..4a5be9d1a58 100644 --- a/core/services/workflows/syncer/orm.go +++ b/core/services/workflows/syncer/orm.go @@ -3,7 +3,6 @@ package syncer import ( "context" "database/sql" - "errors" "time" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -232,9 +231,6 @@ func (orm *orm) GetWorkflowSpec(ctx context.Context, owner, name string) (*job.W var spec job.WorkflowSpec err := orm.ds.GetContext(ctx, &spec, query, owner, name) if err != nil { - if errors.Is(err, sql.ErrNoRows) { - return nil, nil // No spec found - } return nil, err } diff --git a/core/services/workflows/syncer/orm_test.go b/core/services/workflows/syncer/orm_test.go index 7ad013d64f3..1be4e54f472 100644 --- a/core/services/workflows/syncer/orm_test.go +++ b/core/services/workflows/syncer/orm_test.go @@ -192,7 +192,7 @@ func Test_GetWorkflowSpec(t *testing.T) { t.Run("fails if no workflow spec exists", func(t *testing.T) { dbSpec, err := orm.GetWorkflowSpec(ctx, "owner-123", "Test Workflow") - require.NoError(t, err) + require.Error(t, err) require.Nil(t, dbSpec) }) }