projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ad4fd0
)
Do not panic on permission denied
author
bep
<bjorn.erik.pedersen@gmail.com>
Tue, 27 Jan 2015 15:51:24 +0000
(16:51 +0100)
committer
bep
<bjorn.erik.pedersen@gmail.com>
Tue, 27 Jan 2015 15:51:24 +0000
(16:51 +0100)
Replace panic with FATAL logging and graceful shutdown.
Fixes #837
helpers/path.go
patch
|
blob
|
history
diff --git
a/helpers/path.go
b/helpers/path.go
index 351b7a11a2948599bb1b6297a0b1c49f21d12cbb..3351e02651e881dacfa1a4406710ee2e35b1cd79 100644
(file)
--- 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)
}
}
}