diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2022-01-16 17:30:07 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2022-01-16 17:30:14 -0700 |
commit | 1a7a78a1f27bdf58e9921cc636375385840a2dc5 (patch) | |
tree | 31986abf04617b9652368e4a60cd65dc77bd4693 /cmd | |
parent | 1feb65952acd814f9abcfb8e38f727f4e49e9e68 (diff) |
cmd: Print error if fmt overwrite fails (fix #4524)
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/commandfuncs.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go index bc62f28..ec56ab9 100644 --- a/cmd/commandfuncs.go +++ b/cmd/commandfuncs.go @@ -567,7 +567,7 @@ func cmdFmt(fl Flags) (int, error) { if fl.Bool("overwrite") { if err := os.WriteFile(formatCmdConfigFile, output, 0600); err != nil { - return caddy.ExitCodeFailedStartup, nil + return caddy.ExitCodeFailedStartup, fmt.Errorf("overwriting formatted file: %v", err) } } else { fmt.Print(string(output)) |