Skip to content

Commit 0dcd82f

Browse files
committed
update error messages
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
1 parent 780480f commit 0dcd82f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/cli/pkg/action/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@ func ValidateAndExtractName(explicitName, filePath string) (string, error) {
6464
if filePath != "" {
6565
content, err = LoadFileOrURL(filePath)
6666
if err != nil {
67-
return "", fmt.Errorf("failed to load file: %w", err)
67+
return "", fmt.Errorf("load file: %w", err)
6868
}
6969
}
7070

7171
// Extract name from v2 metadata (if present)
7272
metadataName, err := extractNameFromMetadata(content)
7373
if err != nil {
74-
return "", fmt.Errorf("failed to parse content: %w", err)
74+
return "", fmt.Errorf("parse content: %w", err)
7575
}
7676

7777
// Both provided - ambiguous
7878
if explicitName != "" && metadataName != "" {
79-
return "", fmt.Errorf("conflicting names: explicit name (%q) and metadata.name (%q) both provided. Please provide only one", explicitName, metadataName)
79+
return "", fmt.Errorf("conflicting names: explicit name (%q) and metadata.name (%q) both provided", explicitName, metadataName)
8080
}
8181

8282
// Neither provided - missing required name

app/controlplane/internal/service/workflowcontract.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ func validateAndExtractName(rawContract []byte, explicitName string) (string, er
324324
if explicitName != "" && metadataName != "" {
325325
// If both are provided but different, that's a conflict
326326
if explicitName != metadataName {
327-
return "", errors.BadRequest("invalid", "conflicting names: explicit name and metadata.name are different. Please provide only one.")
327+
return "", errors.BadRequest("invalid", "conflicting names: explicit name and metadata.name are different")
328328
}
329329
// Names match, return it
330330
return explicitName, nil

0 commit comments

Comments
 (0)