Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve error logs (#10592) #17089

Merged
merged 1 commit into from
Feb 5, 2024
Merged
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: 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
Loading