OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package commonErrors | |
6 | |
7 import ( | |
8 "reflect" | |
9 | |
10 "appengine/datastore" | |
11 "appengine/memcache" | |
12 "appengine/taskqueue" | |
13 ) | |
14 | |
15 // Common errors originating from the GAE SDK | |
16 var ( | |
17 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
| |
18 ErrNoStatsMC = memcache.ErrNoStats | |
19 ErrCacheMissMC = memcache.ErrCacheMiss | |
20 ErrNotStoredMC = memcache.ErrNotStored | |
21 ErrServerErrorMC = memcache.ErrServerError | |
22 | |
23 ErrInvalidKeyDS = datastore.ErrInvalidKey | |
24 ErrConcurrentTransactionDS = datastore.ErrConcurrentTransaction | |
25 ErrNoSuchEntityDS = datastore.ErrNoSuchEntity | |
26 ErrInvalidEntityTypeDS = datastore.ErrInvalidEntityType | |
27 | |
28 ErrTaskAlreadyAddedTQ = taskqueue.ErrTaskAlreadyAdded | |
29 ) | |
30 | |
31 // TODO(riannucci): Add common internal errors which originate from the | |
32 // dev_appserver SDK | |
33 | |
34 // ErrFieldMismatchDS returns a datastore.ErrFieldMismatch struct filled with | |
35 // the given specification | |
36 func ErrFieldMismatchDS(structType reflect.Type, fieldName, reason string) error { | |
37 return &datastore.ErrFieldMismatch{ | |
38 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.
| |
39 } | |
OLD | NEW |