mirror of
https://github.com/caddyserver/caddy.git
synced 2025-11-02 06:11:06 +00:00
chore: check against errors of io/fs instead of os (#6011)
* chore: replace `os.ErrNotExist` with `fs.ErrNotExist` * check against permission error from `io/fs` package
This commit is contained in:
parent
b568a10dd4
commit
787f6b257f
7 changed files with 23 additions and 22 deletions
|
|
@ -190,7 +190,7 @@ func cmdRun(fl Flags) (int, error) {
|
|||
var config []byte
|
||||
if resumeFlag {
|
||||
config, err = os.ReadFile(caddy.ConfigAutosavePath)
|
||||
if os.IsNotExist(err) {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
// not a bad error; just can't resume if autosave file doesn't exist
|
||||
caddy.Log().Info("no autosave file exists", zap.String("autosave_file", caddy.ConfigAutosavePath))
|
||||
resumeFlag = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue