Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: go/src/infra/gae/libs/gae/upstream_errors.go

Issue 1227183003: Change RawDatastore to do less reflection. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@move_dummy
Patch Set: fix No/ShouldIndex Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/gae/libs/gae/raw_datastore.go ('k') | go/src/infra/gae/libs/meta/eg.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/gae/upstream_errors.go
diff --git a/go/src/infra/gae/libs/gae/upstream_errors.go b/go/src/infra/gae/libs/gae/upstream_errors.go
index f6ebad5538ae2b3dd14ae34b0f3f6766cb8a9cf5..6194ac770e18783bfd59cfb5608b5a3952a30831 100644
--- a/go/src/infra/gae/libs/gae/upstream_errors.go
+++ b/go/src/infra/gae/libs/gae/upstream_errors.go
@@ -46,6 +46,22 @@ var (
/////////////////////////////// Supporting code ////////////////////////////////
+// ErrDSFieldMismatch is returned when a field is to be loaded into a different
+// type than the one it was stored from, or when a field is missing or
+// unexported in the destination struct.
+// StructType is the type of the struct pointed to by the destination argument
+// passed to Get or to Iterator.Next.
+type ErrDSFieldMismatch struct {
+ StructType reflect.Type
+ FieldName string
+ Reason string
+}
+
+func (e *ErrDSFieldMismatch) Error() string {
+ return fmt.Sprintf("gae: cannot load field %q into a %q: %s",
+ e.FieldName, e.StructType, e.Reason)
+}
+
// 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.
« no previous file with comments | « go/src/infra/gae/libs/gae/raw_datastore.go ('k') | go/src/infra/gae/libs/meta/eg.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698