app/vmauth: consistently use '%w' for formatting errors in fmt.Errorf()

This commit is contained in:
Aliaksandr Valialkin 2023-09-21 11:04:13 +02:00
parent 462c918251
commit f16cbc726e
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -382,7 +382,7 @@ var stopCh chan struct{}
func loadAuthConfig() (bool, error) {
data, err := fs.ReadFileOrHTTP(*authConfigPath)
if err != nil {
return false, fmt.Errorf("failed to read -auth.config=%q: %s", *authConfigPath, err)
return false, fmt.Errorf("failed to read -auth.config=%q: %w", *authConfigPath, err)
}
oldData := authConfigData.Load()
@ -393,12 +393,12 @@ func loadAuthConfig() (bool, error) {
ac, err := parseAuthConfig(data)
if err != nil {
return false, fmt.Errorf("failed to parse -auth.config=%q: %s", *authConfigPath, err)
return false, fmt.Errorf("failed to parse -auth.config=%q: %w", *authConfigPath, err)
}
m, err := parseAuthConfigUsers(ac)
if err != nil {
return false, fmt.Errorf("failed to parse users from -auth.config=%q: %s", *authConfigPath, err)
return false, fmt.Errorf("failed to parse users from -auth.config=%q: %w", *authConfigPath, err)
}
logger.Infof("loaded information about %d users from -auth.config=%q", len(m), *authConfigPath)