Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
update validation of exec err (#125)
Browse files Browse the repository at this point in the history
* update validation of exec err
  • Loading branch information
roneli authored Dec 9, 2021
1 parent be1cd34 commit c7d150c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.5.4] - 2021-12-09

### :spider: Fixed
* fixed bad execution error validation [#125](https://github.com/cloudquery/cq-provider-sdk/pull/125)

## [v0.5.3] - 2021-12-06

### :gear: Changed
Expand Down
6 changes: 6 additions & 0 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package provider
import (
"context"
"embed"
"errors"
"fmt"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -244,6 +245,11 @@ func (p *Provider) collectExecutionDiagnostics(client schema.ClientMeta, exec sc
p.Logger.Debug("collecting diagnostics for resource execution", "resource", exec.ResourceName)
diagnostics := make(diag.Diagnostics, 0)
for _, e := range exec.PartialFetchFailureResult {
var execErr *diag.ExecutionError
if errors.As(e.Err, &execErr) {
diagnostics = append(diagnostics, execErr)
continue
}
if d, ok := e.Err.(diag.Diagnostic); ok {
diagnostics = append(diagnostics, d)
continue
Expand Down

0 comments on commit c7d150c

Please sign in to comment.