Skip to content

DatastoreException - Error Code/Reason are inconsistent when working with Emulator  #2442

@sai-pullabhotla

Description

@sai-pullabhotla

I'm trying to implement sai-pullabhotla/catatumbo#172 to throw specialized exceptions in certain cases, more specifically, for NOT_FOUND and ALREADY_EXISTS errors.

As per this page -

NOT_FOUND = 5 
ALREADY_EXISTS = 6 

This works well and get the expected codes when working with the real/live GCD, but when using the Datastore Emulator, both test cases result in a code of INVALID_ARGUMENT = 3

FYI - Just did an update on gcloud/emulator and the issue remains. The gcloud versions are -

Google Cloud SDK 171.0.0
beta 2017.03.24
bq 2.0.25
cloud-datastore-emulator 1.2.1
core 2017.09.11
gcloud
gsutil 4.27

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions