AB#2033 Remove redundant "failed" in error wrapping

Remove "failed" from wrapped errors
Where appropriate rephrase "unable to/could not" to "failed" in root
errors
Start error log messages with "Failed"
This commit is contained in:
Christoph Meyer 2022-06-09 14:04:30 +00:00 committed by cm
parent 0c9ca50be8
commit 9441e46e4b
56 changed files with 204 additions and 204 deletions

View file

@ -69,7 +69,7 @@ func (c *ServiceAccountCreator) createServiceAccountGCP(ctx context.Context, cl
stat state.ConstellationState, config *config.Config,
) (string, state.ConstellationState, error) {
if err := cl.SetState(stat); err != nil {
return "", state.ConstellationState{}, fmt.Errorf("failed to set state while creating service account: %w", err)
return "", state.ConstellationState{}, fmt.Errorf("setting state while creating service account: %w", err)
}
input := gcpcl.ServiceAccountInput{
@ -77,12 +77,12 @@ func (c *ServiceAccountCreator) createServiceAccountGCP(ctx context.Context, cl
}
serviceAccount, err := cl.CreateServiceAccount(ctx, input)
if err != nil {
return "", state.ConstellationState{}, fmt.Errorf("failed to create service account: %w", err)
return "", state.ConstellationState{}, fmt.Errorf("creating service account: %w", err)
}
stat, err = cl.GetState()
if err != nil {
return "", state.ConstellationState{}, fmt.Errorf("failed to get state after creating service account: %w", err)
return "", state.ConstellationState{}, fmt.Errorf("getting state after creating service account: %w", err)
}
return serviceAccount, stat, nil
}
@ -91,16 +91,16 @@ func (c *ServiceAccountCreator) createServiceAccountAzure(ctx context.Context, c
stat state.ConstellationState, config *config.Config,
) (string, state.ConstellationState, error) {
if err := cl.SetState(stat); err != nil {
return "", state.ConstellationState{}, fmt.Errorf("failed to set state while creating service account: %w", err)
return "", state.ConstellationState{}, fmt.Errorf("setting state while creating service account: %w", err)
}
serviceAccount, err := cl.CreateServicePrincipal(ctx)
if err != nil {
return "", state.ConstellationState{}, fmt.Errorf("failed to create service account: %w", err)
return "", state.ConstellationState{}, fmt.Errorf("creating service account: %w", err)
}
stat, err = cl.GetState()
if err != nil {
return "", state.ConstellationState{}, fmt.Errorf("failed to get state after creating service account: %w", err)
return "", state.ConstellationState{}, fmt.Errorf("getting state after creating service account: %w", err)
}
return serviceAccount, stat, nil
}