From: bep Date: Tue, 27 Jan 2015 15:51:24 +0000 (+0100) Subject: Do not panic on permission denied X-Git-Tag: v0.13~102 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=251f5e9d;p=brevno-suite%2Fhugo Do not panic on permission denied Replace panic with FATAL logging and graceful shutdown. Fixes #837 --- diff --git a/helpers/path.go b/helpers/path.go index 351b7a11..3351e026 100644 --- a/helpers/path.go +++ b/helpers/path.go @@ -17,6 +17,7 @@ import ( "errors" "fmt" "github.com/spf13/afero" + jww "github.com/spf13/jwalterweatherman" "github.com/spf13/viper" "io" "os" @@ -391,7 +392,7 @@ func WriteToDisk(inpath string, r io.Reader, fs afero.Fs) (err error) { err = fs.MkdirAll(ospath, 0777) // rwx, rw, r if err != nil { if err != os.ErrExist { - panic(err) + jww.FATAL.Fatalln(err) } } }