I am calling into the AppEngine Datastore to get data that may or may not be stored; I am not concerned with a multi error except in the case that all of the multi error entries return an error.
err := datastore.GetMulti(context, keys, data)
if err_entries, ok := err.(appengine.MultiError); ok {
for _, err_entry := range err_entries {
if err_entry == nil {
return data, nil
}
}
}
return data, err
My question is whether the data returned, given that one err_entry of a multi error is nil, will contain false, empty, or corrupt data entries for keys that match an error in the multi error. It works as expected for now but I don't know what potential exceptions might come up or if this is horrendous for some idiomatic reason.
Right from https://developers.google.com/appengine/docs/go/reference#MultiError:
MultiError is returned by batch operations when there are errors with particular elements.
Errors will be in a one-to-one correspondence with the input elements; successful elements will have a nil entry.
It will never have data, each i, err_entry
is either nil or an error linked to data[i]
.