Skip to content

Commit

Permalink
Return error instead of panic in WriteReader
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Jan 15, 2018
1 parent 57afd63 commit bb8f192
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"bytes"
"fmt"
"io"
"log"
"os"
"path/filepath"
"strings"
Expand All @@ -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
}
}
}
Expand Down

0 comments on commit bb8f192

Please sign in to comment.