Good point, I will catch the cache errors.

On 13 May 2014, at 16:52, Iván Perdomo <notifications@github.com> wrote:

> In GAE/src/com/gallatinsystems/gis/map/MapUtils.java:
> 
> >                      showOnPublicMap = (Boolean) cache.get(pubKey);
> >                  } else {
> >                      Survey s = sDao.getByKey(surveyId);
> >                      if (s != null) {
> >                          showOnPublicMap = showOnPublicMap || "Point".equals(s.getPointType())
> >                                  || "PublicInstitution".equals(s.getPointType());
> > -                        cache.put(pubKey, showOnPublicMap);
> > +                        if (cache != null){
> > +                        	cache.put(pubKey, showOnPublicMap);
> The usage of cache should be an optimization, we have seen in the past that a cache.put(Object,Object) can fail, e.g.
> 
> Memcache put: Error setting single item ({62860210=45050049})
> Memcache put: Error setting single item ({68810184=67721459})
> The API call memcache.Set() took too long to respond and was cancelled.
> Do we want to catch a possible Exception and treat it properly?
> 
> An cache.put could raise an MemcacheServiceException. See: https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/memcache/MemcacheService#put%28java.lang.Object,%20java.lang.Object%29
> 
> An we can use 
> https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/memcache/ConsistentErrorHandler
> 
> Handles back-end service errors. This method is called from most of the MemcacheService methods in the event of a service error. The handler may throw any RuntimeException, or it may simply return for "permissive" error handling, which will generally emulate behavior of a cache miss due to a discarded entry.
> 
> —
> Reply to this email directly or view it on GitHub.
>