Browse Source

improving error handling

tags/v1.0.0
Remco 9 years ago
parent
commit
09c9f4d866
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      transfersh-server/handlers.go
  2. +1
    -1
      transfersh-server/main.go

+ 1
- 0
transfersh-server/handlers.go 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
}


+ 1
- 1
transfersh-server/main.go 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{


Loading…
Cancel
Save