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

Side by Side Diff: go/src/infra/gae/libs/wrapper/gae/commonErrors/errors.go

Issue 1222903002: Refactor current GAE abstraction library to be free of the SDK* (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: more fixes 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 unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698