Chromium Code Reviews| Index: go/src/infra/gae/libs/wrapper/gae/commonErrors/errors.go |
| diff --git a/go/src/infra/gae/libs/wrapper/gae/commonErrors/errors.go b/go/src/infra/gae/libs/wrapper/gae/commonErrors/errors.go |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9be66adda181e2a5f0c7cf0aab51ec2fe7be6d62 |
| --- /dev/null |
| +++ b/go/src/infra/gae/libs/wrapper/gae/commonErrors/errors.go |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package commonErrors |
| + |
| +import ( |
| + "reflect" |
| + |
| + "appengine/datastore" |
| + "appengine/memcache" |
| + "appengine/taskqueue" |
| +) |
| + |
| +// Common errors originating from the GAE SDK |
| +var ( |
| + ErrCASConflictMC = memcache.ErrCASConflict |
|
M-A Ruel
2015/05/27 00:27:11
Why the aliasing exactly?
iannucci
2015/05/27 02:40:57
So then you can BreakFeatures(commonErrors.Somethi
|
| + ErrNoStatsMC = memcache.ErrNoStats |
| + ErrCacheMissMC = memcache.ErrCacheMiss |
| + ErrNotStoredMC = memcache.ErrNotStored |
| + ErrServerErrorMC = memcache.ErrServerError |
| + |
| + ErrInvalidKeyDS = datastore.ErrInvalidKey |
| + ErrConcurrentTransactionDS = datastore.ErrConcurrentTransaction |
| + ErrNoSuchEntityDS = datastore.ErrNoSuchEntity |
| + ErrInvalidEntityTypeDS = datastore.ErrInvalidEntityType |
| + |
| + ErrTaskAlreadyAddedTQ = taskqueue.ErrTaskAlreadyAdded |
| +) |
| + |
| +// TODO(riannucci): Add common internal errors which originate from the |
| +// dev_appserver SDK |
| + |
| +// ErrFieldMismatchDS returns a datastore.ErrFieldMismatch struct filled with |
| +// the given specification |
| +func ErrFieldMismatchDS(structType reflect.Type, fieldName, reason string) error { |
| + return &datastore.ErrFieldMismatch{ |
| + StructType: structType, FieldName: fieldName, Reason: reason} |
|
M-A Ruel
2015/05/27 00:27:11
then one item per line.
iannucci
2015/05/27 02:40:57
done.
|
| +} |