You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the batch function returned the wrong number of responses, return an error to all callers
134
134
iflen(batch.results) !=len(batch.keys) {
135
-
returndata, fmt.Errorf("bug in loader: %d values returned for %d keys", len(batch.results), len(batch.keys))
135
+
returndata, fmt.Errorf("bug in fetch function: %d values returned for %d keys", len(batch.results), len(batch.keys))
136
136
}
137
137
138
138
ifpos<len(batch.results) {
139
139
data=batch.results[pos]
140
140
}
141
141
142
142
varerrerror
143
-
ifbatch.errors!=nil {
144
-
err=batch.errors[pos]
143
+
iflen(batch.errors) !=0 {
144
+
ifpos<len(batch.errors) {
145
+
err=batch.errors[pos]
146
+
} else {
147
+
err=fmt.Errorf("bug in fetch function: %d errors returned for %d keys; last error: %w", len(batch.errors), len(batch.keys), batch.errors[len(batch.errors)-1])
0 commit comments