Skip to content

Commit

Permalink
chore: improve error logs (argoproj#10933)
Browse files Browse the repository at this point in the history
Signed-off-by: Prajilesh <nprajilesh@gmail.com>

Signed-off-by: Prajilesh <nprajilesh@gmail.com>
Signed-off-by: Nicholas Johnson <nbjohnson10@gmail.com>
  • Loading branch information
nprajilesh authored and nbjohnson committed Oct 18, 2022
1 parent 24b5475 commit 7bc75bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions controller/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func (c *liveStateCache) getCluster(server string) (clustercache.ClusterCache, e

cluster, err := c.db.GetCluster(context.Background(), server)
if err != nil {
return nil, err
return nil, fmt.Errorf("error getting cluster: %w", err)
}

if !c.canHandleCluster(cluster) {
Expand Down Expand Up @@ -456,11 +456,11 @@ func (c *liveStateCache) getCluster(server string) (clustercache.ClusterCache, e
func (c *liveStateCache) getSyncedCluster(server string) (clustercache.ClusterCache, error) {
clusterCache, err := c.getCluster(server)
if err != nil {
return nil, err
return nil, fmt.Errorf("error getting cluster: %w", err)
}
err = clusterCache.EnsureSynced()
if err != nil {
return nil, err
return nil, fmt.Errorf("error synchronizing cache state : %w", err)
}
return clusterCache, nil
}
Expand Down Expand Up @@ -594,7 +594,7 @@ func (c *liveStateCache) watchSettings(ctx context.Context) {
func (c *liveStateCache) Init() error {
cacheSettings, err := c.loadCacheSettings()
if err != nil {
return err
return fmt.Errorf("error loading cache settings: %w", err)
}
c.cacheSettings = *cacheSettings
return nil
Expand Down
2 changes: 1 addition & 1 deletion util/github_app/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type repoAsCredentials struct {
func (r *repoAsCredentials) GetAuthSecret(ctx context.Context, secretName string) (*github_app_auth.Authentication, error) {
repo, err := r.GetRepoCredsBySecretName(ctx, secretName)
if err != nil {
return nil, err
return nil, fmt.Errorf("error getting creds for %s: %w", secretName, err)
}
if repo == nil || repo.GithubAppPrivateKey == "" {
return nil, fmt.Errorf("no github app found for %s", secretName)
Expand Down

0 comments on commit 7bc75bf

Please sign in to comment.