List of Datastore possible errors?

41 views
Skip to first unread message

Fred Janon

unread,
Jun 23, 2014, 5:41:11 PM6/23/14
to google-ap...@googlegroups.com
There are very few errors listed in the Go Datastore reference and almost no detail about the errors sent back by a call to the datastore, to know when to retry or abort.


Is there a place where all the errors are listed?

I would really like to see the errors when the datastore is unavailable or in read mode like here:


I think it would be nice to have the same for all the GAE services, like Search



Thanks

Fred

David Symonds

unread,
Jun 23, 2014, 8:15:36 PM6/23/14
to Fred Janon, google-appengine-go
On 24 June 2014 07:41, Fred Janon <fja...@gmail.com> wrote:

> There are very few errors listed in the Go Datastore reference and almost no
> detail about the errors sent back by a call to the datastore, to know when
> to retry or abort.
>
> https://developers.google.com/appengine/docs/go/datastore/reference
>
> Is there a place where all the errors are listed?

Any specific errors that that package returns are listed there.

> I would really like to see the errors when the datastore is unavailable or
> in read mode like here:
>
> https://developers.google.com/appengine/articles/handling_datastore_errors

If you are using the HR datastore (which you have to for Go) then
there's no read-only mode. The "appengine" package has IsOverQuota and
IsCapabilityDisabled functions for checking some classes of errors
across APIs.

> I think it would be nice to have the same for all the GAE services, like
> Search
>
> https://developers.google.com/appengine/docs/go/search/reference

We have a general policy of returning distinguished errors when there
is a reasonable thing an application can do differently. If you have
particular scenarios in mind, please let us know.

Fred Janon

unread,
Jun 25, 2014, 11:02:15 AM6/25/14
to google-ap...@googlegroups.com, fja...@gmail.com
Then there is no Go equivalent for the Java " DatastoreFailureException" when the service goes down?

Should I understand that once my apps are tested so there is no programming error, any not nil error returned by the GAE services should be considered as fatal errors and not retry?

Thanks

Fred

Matthew Zimmerman

unread,
Jun 25, 2014, 11:16:00 AM6/25/14
to Fred Janon, google-appengine-go
There's a couple of helper functions around errors that help you
determine if you should retry them. They're not perfect as you
mention.

https://developers.google.com/appengine/docs/go/reference#IsTimeoutError

Timeouts I would think you'd want to try again (within reason). Quota
errors probably not.
> --
> You received this message because you are subscribed to the Google Groups
> "google-appengine-go" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengin...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

David Symonds

unread,
Jun 25, 2014, 7:46:56 PM6/25/14
to Fred Janon, google-appengine-go
On 26 June 2014 01:02, Fred Janon <fja...@gmail.com> wrote:

> Then there is no Go equivalent for the Java " DatastoreFailureException"
> when the service goes down?

There's no distinguished error, no. An error will be returned though.

> Should I understand that once my apps are tested so there is no programming
> error, any not nil error returned by the GAE services should be considered
> as fatal errors and not retry?

I wouldn't say "fatal", since that depends on your application's
logic, but yes, any non-nil error indicates something went wrong. A
timeout error (predicated by appengine.IsTimeoutError) is perhaps
retryable, though.

Fred Janon

unread,
Jun 26, 2014, 11:51:46 AM6/26/14
to google-ap...@googlegroups.com, fja...@gmail.com
Thanks Matthew and David.
Reply all
Reply to author
Forward
0 new messages