Skip to content

Commit

Permalink
fix(resources): resolve error comments/ return available data
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtkeller committed Nov 5, 2024
1 parent 3974617 commit 0f699fc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/pkg/domains/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ func (d Domain) GetResources(ctx context.Context) (types.DomainResources, error)
// get a list of all the files we just downloaded in the temporary directory
files, err := listFiles(dst)
if err != nil {
errs = errors.Join(errs, fmt.Errorf("error walking downloaded file tree: %w", err))
return tmpDRs, errs
return tmpDRs, errors.Join(errs, fmt.Errorf("error walking downloaded file tree: %w", err))
}

// conftest's parser returns a map[string]interface where the filenames are
Expand Down Expand Up @@ -112,7 +111,7 @@ func (d Domain) GetResources(ctx context.Context) (types.DomainResources, error)
// make a sub directory by parser name
parserDir, err := os.MkdirTemp(dst, parserName)
if err != nil {
return nil, err
return drs, err
}

for _, fi := range filesByParser {
Expand All @@ -130,13 +129,12 @@ func (d Domain) GetResources(ctx context.Context) (types.DomainResources, error)
// get a list of all the files we just downloaded in the temporary directory
files, err := listFiles(parserDir)
if err != nil {
errs = errors.Join(errs, fmt.Errorf("error walking downloaded file tree: %w", err))
return drs, errs
return drs, errors.Join(errs, fmt.Errorf("error walking downloaded file tree: %w", err))
}

parsedConfig, err := parser.ParseConfigurationsAs(files, parserName)
if err != nil {
return nil, err
return drs, err
}

for k, v := range parsedConfig {
Expand Down

0 comments on commit 0f699fc

Please sign in to comment.