diff --git a/cache_filesystem.go b/cache_filesystem.go index a5bcb1e..196ffb4 100644 --- a/cache_filesystem.go +++ b/cache_filesystem.go @@ -26,15 +26,15 @@ func filesystemCache(center s2.LatLng, zoom int, marker []marker, x, y int) (io. } buf := new(bytes.Buffer) - if _, err := io.Copy(buf, mapReader); err != nil { + if _, err = io.Copy(buf, mapReader); err != nil { return nil, err } - if err := os.MkdirAll(path.Dir(cacheFileName), 0755); err != nil { + if err = os.MkdirAll(path.Dir(cacheFileName), 0700); err != nil { return nil, err } - if err := ioutil.WriteFile(cacheFileName, buf.Bytes(), 0644); err != nil { + if err = ioutil.WriteFile(cacheFileName, buf.Bytes(), 0644); err != nil { return nil, err } diff --git a/main.go b/main.go index 9846016..7a2fd9c 100644 --- a/main.go +++ b/main.go @@ -91,7 +91,7 @@ func handleMapRequest(res http.ResponseWriter, r *http.Request) { } if mapReader, err = cacheFunc(*center, zoom, markers, x, y); err != nil { - log.Error("Map render failed: %s (Request: %s)", err, r.URL.String()) + log.Errorf("Map render failed: %s (Request: %s)", err, r.URL.String()) http.Error(res, fmt.Sprintf("I experienced difficulties rendering your map: %s", err), http.StatusInternalServerError) return }