mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-01 11:36:10 -04:00
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:
parent
0c9ca50be8
commit
9441e46e4b
56 changed files with 204 additions and 204 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue