Skip to content

Commit

Permalink
fixup! Capitalize error messages
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Sul <[email protected]>
  • Loading branch information
mike-sul committed Feb 6, 2024
1 parent dfb80e8 commit b0a1091
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions subcommands/targets/offline-update.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ func getWaveTargetMeta(factory string, targetName string, wave string) (*tuf.Fil
waveTargets, err := api.WaveTargetsList(factory, true, wave)
if err != nil {
if herr := client.AsHttpError(err); herr != nil && herr.Response.StatusCode == 404 {
return nil, fmt.Errorf("no active Wave with the specified name was found; wave: %s", wave)
return nil, fmt.Errorf("No active Wave with the specified name was found; wave: %s", wave)
}
return nil, fmt.Errorf("failed to get Wave Target metadata: %s", err.Error())
return nil, fmt.Errorf("Failed to get Wave Target metadata: %s", err.Error())
}
if foundTargetMeta, ok := waveTargets[wave].Signed.Targets[targetName]; ok {
return &foundTargetMeta, nil
} else {
return nil, fmt.Errorf("the specified Target is not found among wave targets;"+
return nil, fmt.Errorf("The specified Target is not found among wave targets;"+
" target: %s, wave: %s", targetName, wave)
}
}
Expand All @@ -193,14 +193,14 @@ func getProdTargetMeta(factory string, targetName string, tag string) (*tuf.File
targets, err := api.ProdTargetsGet(factory, tag, true)
if err != nil {
if herr := client.AsHttpError(err); herr != nil && herr.Response.StatusCode == 404 {
return nil, fmt.Errorf("no production targets were found for the specified tag `%s`", tag)
return nil, fmt.Errorf("No production targets were found for the specified tag `%s`", tag)
}
return nil, fmt.Errorf("failed to get production Target metadata: %s", err.Error())
return nil, fmt.Errorf("Failed to get production Target metadata: %s", err.Error())
}
if foundTargetMeta, ok := targets.Signed.Targets[targetName]; ok {
return &foundTargetMeta, nil
} else {
return nil, fmt.Errorf("no production target with the given tag is found;"+
return nil, fmt.Errorf("No production target with the given tag is found;"+
" target: %s, tag: %s", targetName, tag)
}
}
Expand All @@ -209,9 +209,9 @@ func getCiTargetMeta(factory string, targetName string, tag string) (*tuf.FileMe
data, err := api.TufMetadataGet(factory, "targets.json", tag, false)
if err != nil {
if herr := client.AsHttpError(err); herr != nil && herr.Response.StatusCode == 404 {
return nil, fmt.Errorf("no CI targets were found for the specified tag `%s`", tag)
return nil, fmt.Errorf("No CI targets were found for the specified tag `%s`", tag)
}
return nil, fmt.Errorf("failed to get CI Target metadata: %s", err.Error())
return nil, fmt.Errorf("Failed to get CI Target metadata: %s", err.Error())
}
targets := client.AtsTufTargets{}
err = json.Unmarshal(*data, &targets)
Expand All @@ -221,7 +221,7 @@ func getCiTargetMeta(factory string, targetName string, tag string) (*tuf.FileMe
if foundTargetMeta, ok := targets.Signed.Targets[targetName]; ok {
return &foundTargetMeta, nil
} else {
return nil, fmt.Errorf("no CI target with the given tag is found;"+
return nil, fmt.Errorf("No CI target with the given tag is found;"+
" target: %s, tag: %s", targetName, tag)
}
}
Expand Down

0 comments on commit b0a1091

Please sign in to comment.