From 09c9f4d8665e3e8fe51f188d0bef93f00cc62400 Mon Sep 17 00:00:00 2001 From: Remco Date: Wed, 12 Nov 2014 13:13:04 +0100 Subject: [PATCH] improving error handling --- transfersh-server/handlers.go | 1 + transfersh-server/main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/transfersh-server/handlers.go b/transfersh-server/handlers.go index d1aad70..2a32119 100644 --- a/transfersh-server/handlers.go +++ b/transfersh-server/handlers.go @@ -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 } diff --git a/transfersh-server/main.go b/transfersh-server/main.go index 7186fba..6369705 100644 --- a/transfersh-server/main.go +++ b/transfersh-server/main.go @@ -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{