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 | |
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, | |
39 FieldName: fieldName, | |
40 Reason: reason, | |
41 } | |
42 } | |
OLD | NEW |