MCPcopy
hub / github.com/thanos-io/thanos / Add

Method Add

pkg/receive/handler.go:1246–1272  ·  view source on GitHub ↗

Add adds an error to the errorSet.

(err error)

Source from the content-addressed store, hash-verified

1244
1245// Add adds an error to the errorSet.
1246func (es *errorSet) Add(err error) {
1247 if err == nil {
1248 return
1249 }
1250
1251 if len(es.errs) == 0 {
1252 es.errs = []error{err}
1253 } else {
1254 es.errs = append(es.errs, err)
1255 }
1256 if es.reasonSet == nil {
1257 es.reasonSet = make(map[string]struct{})
1258 }
1259
1260 switch addedErr := err.(type) {
1261 case *replicationErrors:
1262 for reason := range addedErr.reasonSet {
1263 es.reasonSet[reason] = struct{}{}
1264 }
1265 case *writeErrors:
1266 for reason := range addedErr.reasonSet {
1267 es.reasonSet[reason] = struct{}{}
1268 }
1269 default:
1270 es.reasonSet[err.Error()] = struct{}{}
1271 }
1272}
1273
1274// writeErrors contains all errors that have
1275// occurred during a local write of a remote-write request.

Callers 15

FetchMethod · 0.45
NewGroupcacheWithConfigFunction · 0.45
setMethod · 0.45
FetchMethod · 0.45
RunReplicateFunction · 0.45
WriteSeriesMethod · 0.45
NextMethod · 0.45
intersectionFunction · 0.45
nextMethod · 0.45
ModifyMethod · 0.45
PopMethod · 0.45
PushMethod · 0.45

Calls 1

ErrorMethod · 0.45