From 0122d9b0c8f94b067d8d5210deb95b33963f037e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 23 Jul 2016 20:44:20 +0200 Subject: changed return code when attachment is too short 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 { -- cgit v0.10.2