projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15003: Format durations as "336h", not "336h0m0s".
[arvados.git]
/
sdk
/
go
/
arvados
/
keep_service.go
diff --git
a/sdk/go/arvados/keep_service.go
b/sdk/go/arvados/keep_service.go
index 9797440205cf3d8396d14ec389e380b2260486b2..0c866354aa9b1e3a34833f15018b66613d40bdb4 100644
(file)
--- a/
sdk/go/arvados/keep_service.go
+++ b/
sdk/go/arvados/keep_service.go
@@
-127,6
+127,13
@@
func (s *KeepService) index(c *Client, url string) ([]KeepServiceIndexEntry, err
scanner := bufio.NewScanner(resp.Body)
sawEOF := false
for scanner.Scan() {
scanner := bufio.NewScanner(resp.Body)
sawEOF := false
for scanner.Scan() {
+ if scanner.Err() != nil {
+ // If we encounter a read error (timeout,
+ // connection failure), stop now and return it
+ // below, so it doesn't get masked by the
+ // ensuing "badly formatted response" error.
+ break
+ }
if sawEOF {
return nil, fmt.Errorf("Index response contained non-terminal blank line")
}
if sawEOF {
return nil, fmt.Errorf("Index response contained non-terminal blank line")
}