Skip to content

Commit

Permalink
chore: improve error logs (argoproj#10592) (argoproj#17089)
Browse files Browse the repository at this point in the history
Signed-off-by: Bardia Heydari <az.bardia13@gmail.com>
  • Loading branch information
k3rn3l-p4n1c authored and mkieweg committed Jun 11, 2024
1 parent 494c0ae commit 43d1a9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions reposerver/gpgwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func StartGPGWatcher(sourcePath string) error {
forceSync := false
watcher, err := fsnotify.NewWatcher()
if err != nil {
return err
return fmt.Errorf("failed to create fsnotify Watcher: %w", err)
}
defer func(watcher *fsnotify.Watcher) {
if err = watcher.Close(); err != nil {
Expand Down Expand Up @@ -83,7 +83,7 @@ func StartGPGWatcher(sourcePath string) error {

err = watcher.Add(sourcePath)
if err != nil {
return err
return fmt.Errorf("failed to add a new source to the watcher: %w", err)
}
<-done
return fmt.Errorf("Abnormal termination of GPG watcher, refusing to continue.")
Expand Down
2 changes: 1 addition & 1 deletion reposerver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func NewServer(metricsServer *metrics.MetricsServer, cache *reposervercache.Cach
}
repoService := repository.NewService(metricsServer, cache, initConstants, argo.NewResourceTracking(), gitCredsStore, filepath.Join(os.TempDir(), "_argocd-repo"))
if err := repoService.Init(); err != nil {
return nil, err
return nil, fmt.Errorf("failed to initialize the repo service: %w", err)
}

return &ArgoCDRepoServer{
Expand Down

0 comments on commit 43d1a9d

Please sign in to comment.