sai-pullabhotla / catatumbo

JPA like Persistence Framework for Google Cloud Datastore and Cloud Firestore
http://catatumbo.io
Apache License 2.0
51 stars 20 forks source link

Create subclasses of EntityManagerException for certain DatastoreExceptions #172

Closed sai-pullabhotla closed 7 years ago

sai-pullabhotla commented 7 years ago

Create subclasses of EntityManagerException for certain DatastoreExceptions.

Use the code from DatastoreException to throw a subclass EntityManagerException. Some useful exceptions would -

EntityAlreadyExistsException - if an attempt was made to insert a duplicate key EntityNotFoundException - if an attempt was made to update a nonexistent entity

https://cloud.google.com/datastore/docs/concepts/errors https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto

sai-pullabhotla commented 7 years ago

Done, but does not work as expected with Datastore Emulator.