improving error handling

This commit is contained in:
Remco 2014-11-12 13:13:04 +01:00
parent d5c8c0320d
commit 09c9f4d866
2 changed files with 2 additions and 1 deletions

View file

@ -348,6 +348,7 @@ func putHandler(w http.ResponseWriter, r *http.Request) {
var err error
if err = storage.Put(token, filename, reader, contentType, uint64(contentLength)); err != nil {
log.Printf("Error during save: %s", err.Error())
http.Error(w, errors.New("Could not save file").Error(), 500)
return
}

View file

@ -164,7 +164,7 @@ func main() {
mime.AddExtensionType(".md", "text/x-markdown")
log.Printf("Transfer.sh server started. :%v using temp folder: %s", *port, config.Temp)
log.Printf("Transfer.sh server started. :\nlistening on port: %v\nusing temp folder: %s\nusing storage provider: %s", *port, config.Temp, *provider)
log.Printf("---------------------------")
s := &http.Server{