Skip to content

Commit

Permalink
Update error message for invalid parse (#546)
Browse files Browse the repository at this point in the history
Signed-off-by: John Reese <john@reese.dev>
  • Loading branch information
jpreese committed Apr 20, 2021
1 parent 1c476fe commit 3c4554d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/commands/parse.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 3c4554d

Please sign in to comment.