We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a496d3 commit 85ba7dbCopy full SHA for 85ba7db
configuration/configuration.go
@@ -17,7 +17,9 @@ package configuration
17
18
import (
19
"encoding/json"
20
+ "errors"
21
"fmt"
22
+ "io/fs"
23
"math/rand"
24
"os"
25
"path/filepath"
@@ -221,8 +223,8 @@ func (c *Configuration) Load() error {
221
223
c.storage = &StorageHCL{}
222
224
}
225
if err = c.storage.Load(c.HAProxy.DataplaneConfig); err != nil {
- if os.IsNotExist(err) {
- log.Warningf("configuration file %s does not exists, creating one", c.HAProxy.DataplaneConfig)
226
+ if errors.Is(err, fs.ErrNotExist) {
227
+ fmt.Printf("configuration file %s does not exists, creating one\n", c.HAProxy.DataplaneConfig)
228
} else {
229
return fmt.Errorf("configuration file %s not valid: %w", c.HAProxy.DataplaneConfig, err)
230
0 commit comments