Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions internal/config/recommendation_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package config

import (
"context"
"errors"
"fmt"
)

Expand Down Expand Up @@ -48,6 +49,10 @@ func (c *globalConfigCache) lookup(ctx context.Context, store AccountConfigReade
}
fetched, err := store.GetServiceConfig(ctx, provider, service)
if err != nil {
if errors.Is(err, ErrNotFound) {
c.missing[k] = true
return nil, nil
}
return nil, fmt.Errorf("get service config %s/%s: %w", provider, service, err)
}
if fetched == nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/store_postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (s *PostgresStore) GetServiceConfig(ctx context.Context, provider, service

if err != nil {
if err == pgx.ErrNoRows {
return nil, fmt.Errorf("service config not found for %s:%s", provider, service)
return nil, fmt.Errorf("service config not found for %s:%s: %w", provider, service, ErrNotFound)
}
return nil, fmt.Errorf("failed to get service config: %w", err)
}
Expand Down
3 changes: 2 additions & 1 deletion internal/config/store_postgres_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"testing"
"time"

Expand Down Expand Up @@ -130,7 +131,7 @@ func (s *testablePostgresStore) GetServiceConfig(ctx context.Context, provider,

if err != nil {
if err == pgx.ErrNoRows {
return nil, errors.New("service config not found")
return nil, fmt.Errorf("service config not found for %s:%s: %w", provider, service, ErrNotFound)
}
return nil, err
}
Expand Down
Loading