mirror of https://github.com/spf13/afero.git
Return error instead of panic in WriteReader
See https://github.com/gohugoio/hugo/issues/4240
This commit is contained in:
parent
57afd63c68
commit
bb8f1927f2
3
util.go
3
util.go
|
@ -20,7 +20,6 @@ import (
|
|||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
@ -46,7 +45,7 @@ func WriteReader(fs Fs, path string, r io.Reader) (err error) {
|
|||
err = fs.MkdirAll(ospath, 0777) // rwx, rw, r
|
||||
if err != nil {
|
||||
if err != os.ErrExist {
|
||||
log.Panicln(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue