Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update error message for invalid parse #546

Merged
merged 1 commit into from Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/commands/parse.go
Expand Up @@ -48,7 +48,7 @@ func NewParseCommand(ctx context.Context) *cobra.Command {
configurations, err = parser.ParseConfigurations(files)
}
if err != nil {
return fmt.Errorf("get configurations: %w", err)
return fmt.Errorf("parse configurations: %w", err)
}

var output string
Expand Down
2 changes: 1 addition & 1 deletion internal/runner/test.go
Expand Up @@ -45,7 +45,7 @@ func (t *TestRunner) Run(ctx context.Context, fileList []string) ([]output.Check
configurations, err = parser.ParseConfigurations(files)
}
if err != nil {
return nil, fmt.Errorf("get configurations: %w", err)
return nil, fmt.Errorf("parse configurations: %w", err)
}

// When there are policies to download, they are currently placed in the first
Expand Down
4 changes: 2 additions & 2 deletions parser/parser.go
Expand Up @@ -169,7 +169,7 @@ func FileSupported(path string) bool {
func ParseConfigurations(files []string) (map[string]interface{}, error) {
configurations, err := parseConfigurations(files, "")
if err != nil {
return nil, fmt.Errorf("get configurations: %w", err)
return nil, err
}

return configurations, nil
Expand All @@ -181,7 +181,7 @@ func ParseConfigurations(files []string) (map[string]interface{}, error) {
func ParseConfigurationsAs(files []string, parser string) (map[string]interface{}, error) {
configurations, err := parseConfigurations(files, parser)
if err != nil {
return nil, fmt.Errorf("parse configurations: %w", err)
return nil, err
}

return configurations, nil
Expand Down