Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion resource/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package resource
import (
"context"
"fmt"
"os"

"github.com/google/cel-go/cel"
"github.com/passbolt/go-passbolt-cli/util"
Expand Down Expand Up @@ -39,7 +40,8 @@ func filterResources(resources *[]api.Resource, celCmd string, ctx context.Conte
// TODO We should decrypt the secret only when required for performance reasonse
_, name, username, uri, pass, desc, err := helper.GetResource(ctx, client, resource.ID)
if err != nil {
return nil, fmt.Errorf("Get Resource %w", err)
fmt.Fprintf(os.Stderr, "Warning: Skipping resource %v: %v\n", resource.ID, err)
continue
}

val, _, err := (*program).ContextEval(ctx, map[string]any{
Expand Down
6 changes: 4 additions & 2 deletions resource/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ func ResourceList(cmd *cobra.Command, args []string) error {
for i := range resources {
_, name, username, uri, pass, desc, err := helper.GetResource(ctx, client, resources[i].ID)
if err != nil {
return fmt.Errorf("Get Resource %w", err)
fmt.Fprintf(cmd.ErrOrStderr(), "Warning: Skipping resource %v: %v\n", resources[i].ID, err)
continue
}
outputResources = append(outputResources, ResourceJsonOutput{
ID: &resources[i].ID,
Expand All @@ -121,7 +122,8 @@ func ResourceList(cmd *cobra.Command, args []string) error {
// TODO We should decrypt the secret only when required for performance reasonse
_, name, username, uri, pass, desc, err := helper.GetResource(ctx, client, resource.ID)
if err != nil {
return fmt.Errorf("Get Resource %w", err)
fmt.Fprintf(cmd.ErrOrStderr(), "Warning: Skipping resource %v: %v\n", resource.ID, err)
continue
}

entry := make([]string, len(columns))
Expand Down