Commit c5bed37e authored by Quentin Smith's avatar Quentin Smith

storage/app: handle upload errors consistently

Change-Id: I79f486a875e4c6858482d406b1c0328655e32aef
Reviewed-on: https://go-review.googlesource.com/38305
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent 35a1a84a
...@@ -33,7 +33,9 @@ func (a *App) upload(w http.ResponseWriter, r *http.Request) { ...@@ -33,7 +33,9 @@ func (a *App) upload(w http.ResponseWriter, r *http.Request) {
case err == ErrResponseWritten: case err == ErrResponseWritten:
return return
case err != nil: case err != nil:
errorf(ctx, "%v", err)
http.Error(w, err.Error(), 500) http.Error(w, err.Error(), 500)
return
} }
if r.Method == http.MethodGet { if r.Method == http.MethodGet {
...@@ -92,6 +94,9 @@ func (a *App) processUpload(ctx context.Context, user string, mr *multipart.Read ...@@ -92,6 +94,9 @@ func (a *App) processUpload(ctx context.Context, user string, mr *multipart.Read
if err == io.EOF { if err == io.EOF {
break break
} }
if err != nil {
return nil, err
}
name := p.FormName() name := p.FormName()
if name == "commit" { if name == "commit" {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment