From 781324986d1619b80219f0d82ace1ce8f41acc22 Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 1 Jul 2021 18:48:58 +0200 Subject: [PATCH] s3store: Return 400 instead of 500 if upload cannot be streamed Closes https://github.com/tus/tusd/issues/490 --- pkg/s3store/s3store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/s3store/s3store.go b/pkg/s3store/s3store.go index 4d5e900..c5431c0 100644 --- a/pkg/s3store/s3store.go +++ b/pkg/s3store/s3store.go @@ -558,7 +558,7 @@ func (upload s3Upload) GetReader(ctx context.Context) (io.Reader, error) { }) if err == nil { // The multipart upload still exists, which means we cannot download it yet - return nil, errors.New("cannot stream non-finished upload") + return nil, handler.NewHTTPError(errors.New("cannot stream non-finished upload"), http.StatusBadRequest) } if isAwsError(err, "NoSuchUpload") {