Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Commit 34bcb13

Browse files
committed
improve a few error messages
1 parent 59f3635 commit 34bcb13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sequins.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"bytes"
55
"encoding/json"
6+
"fmt"
67
"github.com/stripe/sequins/backend"
78
"github.com/stripe/sequins/index"
89
"log"
@@ -103,7 +104,7 @@ func (s *sequins) refresh() error {
103104
index := index.New(path)
104105
err = index.BuildIndex()
105106
if err != nil {
106-
return err
107+
return fmt.Errorf("Error while indexing: %s", err)
107108
}
108109

109110
log.Println("Switching to new directory!")
@@ -148,7 +149,7 @@ func (s *sequins) ServeHTTP(w http.ResponseWriter, r *http.Request) {
148149
if err == index.ErrNotFound {
149150
w.WriteHeader(http.StatusNotFound)
150151
} else if err != nil {
151-
log.Fatal(err)
152+
log.Fatal(fmt.Errorf("Error fetching value for %s: %s", key, err))
152153
w.WriteHeader(http.StatusInternalServerError)
153154
} else {
154155
http.ServeContent(w, r, key, s.updated, bytes.NewReader(res))

0 commit comments

Comments
 (0)