agent-harness / tasks /patches /TASK_CR_002_source.patch
cuber12's picture
Publish agent harness research code and paper artifacts
d61821a verified
Raw
History Blame Contribute Delete
1.5 kB
diff --git a/cache/adapter.go b/cache/adapter.go
index ff913cd3..6780fd5a 100644
--- a/cache/adapter.go
+++ b/cache/adapter.go
@@ -3,8 +3,11 @@ package cache
import (
"context"
"fmt"
+ "maps"
"net/http"
"net/url"
+ "slices"
+ "strings"
"sync"
"time"
@@ -63,7 +66,11 @@ func (m *FactoriesMap) Find(typeName string) (Factory, error) {
factory := m.internal[typeName]
if factory == nil {
- return nil, fmt.Errorf("factory for cache adapter %q was not registered", typeName)
+ return nil, fmt.Errorf(
+ "factory for cache adapter %q was not registered (registered adapters: %s)",
+ typeName,
+ strings.Join(slices.Sorted(maps.Keys(m.internal)), ", "),
+ )
}
return factory, nil
diff --git a/cache/credentials_adapter.go b/cache/credentials_adapter.go
index b64f984b..32a97828 100644
--- a/cache/credentials_adapter.go
+++ b/cache/credentials_adapter.go
@@ -2,6 +2,9 @@ package cache
import (
"fmt"
+ "maps"
+ "slices"
+ "strings"
"sync"
"gitlab.com/gitlab-org/gitlab-runner/cache/cacheconfig"
@@ -48,7 +51,11 @@ func (m *CredentialsFactoriesMap) Find(typeName string) (CredentialsFactory, err
factory := m.internal[typeName]
if factory == nil {
- return nil, fmt.Errorf("factory for credentials adapter %q not registered", typeName)
+ return nil, fmt.Errorf(
+ "factory for credentials adapter %q not registered (registered adapters: %s)",
+ typeName,
+ strings.Join(slices.Sorted(maps.Keys(m.internal)), ", "),
+ )
}
return factory, nil