mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-24 18:11:19 +01:00
fix(config): handle missing config file and middleware directory gracefully and log a warning
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io/fs"
|
||||
"path"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -63,6 +65,9 @@ func LoadComposeFiles() {
|
||||
errs := gperr.NewBuilder("middleware compile errors")
|
||||
middlewareDefs, err := utils.ListFiles(common.MiddlewareComposeBasePath, 0)
|
||||
if err != nil {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
return
|
||||
}
|
||||
log.Err(err).Msg("failed to list middleware definitions")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user