Skip to content

Commit

Permalink
Amend error messages
Browse files Browse the repository at this point in the history
Signed-off-by: Max Lambrecht <[email protected]>
  • Loading branch information
maxlambrecht committed May 19, 2023
1 parent 5941f7a commit 2db4cb4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/server/catalog/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (c *ProvidersRepository) LoadFromProvidersConfig(config *ProvidersConfig) e
return fmt.Errorf("X509CA configuration is required")
}
if config.KeyManager == nil {
return fmt.Errorf("Key Manager configuration is required")
return fmt.Errorf("KeyManager configuration is required")
}
if config.Datastore == nil {
return fmt.Errorf("datastore configuration is required")
Expand All @@ -87,7 +87,7 @@ func (c *ProvidersRepository) LoadFromProvidersConfig(config *ProvidersConfig) e

c.keyManager, err = loadKeyManager(config.KeyManager)
if err != nil {
return fmt.Errorf("error loading Memory: %w", err)
return fmt.Errorf("error loading KeyManager: %w", err)
}
c.datastore, err = loadDatastore(config.Datastore)
if err != nil {
Expand Down Expand Up @@ -130,16 +130,16 @@ func loadKeyManager(c *providerConfig) (keymanager.KeyManager, error) {
case "disk":
kmConfig, err := decodeDiskKeyManagerConfig(c)
if err != nil {
return nil, fmt.Errorf("error decoding disk key manager config: %w", err)
return nil, fmt.Errorf("error decoding disk KeyManager config: %w", err)
}
km, err := keymanager.NewDiskKeyManager(nil, kmConfig.KeysFilePath)
if err != nil {
return nil, fmt.Errorf("error creating disk key manager: %w", err)
return nil, fmt.Errorf("error creating disk KeyManager: %w", err)
}
return km, nil
}

return nil, fmt.Errorf("unknown Memory provider: %s", c.Name)
return nil, fmt.Errorf("unknown KeyManager provider: %s", c.Name)
}

func loadDatastore(config *providerConfig) (db.Datastore, error) {
Expand Down

0 comments on commit 2db4cb4

Please sign in to comment.