File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -166,18 +166,22 @@ loop:
166166 default :
167167 readedBytes , err := reader .Read (b )
168168 if err != nil {
169- log .Errorf ("Errorf reading from reader: %v" , err )
169+ if err == io .EOF {
170+ break loop
171+ }
172+ log .Errorf ("Errorreading from reader: %v" , err )
173+ http .Error (writer , "Error during upload" , http .StatusInternalServerError )
170174 return
171175 }
172176
173177 readed += uint64 (readedBytes )
174178 _ , err = uploadStream .Write (b [0 :readedBytes ])
175179 if err != nil {
176- log . Errorf ( "Errorf writing to stream %v" , err )
177- }
178- // TODO check error here?
179- if err == io . EOF {
180- break loop
180+ if err == io . EOF {
181+ break loop
182+ }
183+ log . Errorf ( "Error writing: %v" , err )
184+ http . Error ( writer , "Error during upload" , http . StatusInternalServerError )
181185 }
182186 }
183187 }
You can’t perform that action at this time.
0 commit comments