File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 7
7
"net/http"
8
8
"time"
9
9
10
+ "github.com/jcelliott/lumber"
11
+
10
12
"github.com/nanopack/hoarder/backends"
11
13
)
12
14
@@ -25,6 +27,7 @@ func get(rw http.ResponseWriter, req *http.Request) {
25
27
// pipe the file rather than consume the rams
26
28
_ , err = io .Copy (rw , r )
27
29
if err != nil {
30
+ lumber .Error ("Failed to pipe file to client - %s" , err .Error ())
28
31
rw .WriteHeader (500 )
29
32
rw .Write ([]byte (fmt .Sprintf ("%s\n " , err )))
30
33
return
@@ -92,6 +95,7 @@ func list(rw http.ResponseWriter, req *http.Request) {
92
95
//
93
96
fis , err := backends .List ()
94
97
if err != nil {
98
+ lumber .Error ("Failed to list backends - %s" , err .Error ())
95
99
rw .WriteHeader (500 )
96
100
rw .Write ([]byte (fmt .Sprintf ("%s\n " , err )))
97
101
return
@@ -102,6 +106,7 @@ func list(rw http.ResponseWriter, req *http.Request) {
102
106
//
103
107
jfis , err := json .Marshal (fis )
104
108
if err != nil {
109
+ lumber .Error ("Failed to marshal results - %s" , err .Error ())
105
110
rw .WriteHeader (500 )
106
111
rw .Write ([]byte (fmt .Sprintf ("%s\n " , err )))
107
112
return
You can’t perform that action at this time.
0 commit comments