Print absolute paths when file caches cannot be written

This commit is contained in:
Frank Denis 2018-03-05 11:58:31 +01:00
parent 4e671cf5ef
commit 75f3c6403b
1 changed files with 7 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import (
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
"time"
"unicode"
@ -170,12 +171,16 @@ func NewSource(xTransport *XTransport, url string, minisignKeyStr string, cacheF
}
if !cached {
if err = AtomicFileWrite(cacheFile, []byte(in)); err != nil {
dlog.Warnf("%s: %s", cacheFile, err)
if absPath, err2 := filepath.Abs(cacheFile); err2 == nil {
dlog.Warnf("%s: %s", absPath, err)
}
}
}
if !sigCached {
if err = AtomicFileWrite(sigCacheFile, []byte(sigStr)); err != nil {
dlog.Warnf("%s: %s", sigCacheFile, err)
if absPath, err2 := filepath.Abs(sigCacheFile); err2 == nil {
dlog.Warnf("%s: %s", absPath, err)
}
}
}
dlog.Noticef("Source [%s] loaded", url)