summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-07-23 18:44:20 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-07-23 18:44:20 (GMT)
commit0122d9b0c8f94b067d8d5210deb95b33963f037e (patch)
tree2608941cffbc4e15d513b6b7cd31c997ddbeac80
parenta42abed52db0006ecd609300bbf064bcb49ea10d (diff)
changed return code when attachment is too short
-rw-r--r--rhimport/fetcher.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/rhimport/fetcher.go b/rhimport/fetcher.go
index f30e57b..801b920 100644
--- a/rhimport/fetcher.go
+++ b/rhimport/fetcher.go
@@ -598,9 +598,9 @@ func writeAttachmentFile(ctx *Context, res *Result, sizeTotal uint64, conv Fetch
return nil
case chunk, ok := <-ctx.AttachmentChan:
if !ok {
- rhl.Printf("receiving attachment '%s' got canceled (channel has been closed prematurely)", ctx.SourceFile)
- res.ResponseCode = http.StatusNoContent
- res.ErrorString = "canceled"
+ rhl.Printf("receiving attachment '%s' failed: channel has been closed prematurely)", ctx.SourceFile)
+ res.ResponseCode = http.StatusBadRequest
+ res.ErrorString = fmt.Sprintf("file upload stopped prematurely (after %d Bytes)", written)
return nil
}
if chunk.Error != nil {