code: private void handleFailure(KeenCallback callback,
                                 KeenProject project,
                                 String eventCollection,
                                 Map<String, Object> event,
                                 Map<String, Object> keenProperties,
                                 Exception e) {
          if (isDebugMode) {
              if (e instanceof RuntimeException) {
                  throw (RuntimeException) e;
              } else {
                  throw new RuntimeException(e);
              }
          } else {
              handleFailure(callback, e);
  
              KeenLogging.log("Encountered error: " + e.getMessage());
              if (callback != null) {
                  try {
                      if (callback instanceof KeenDetailedCallback){
                          ((KeenDetailedCallback)callback).onFailure(project,
                                                                     eventCollection,
                                                                     event,
                                                                     keenProperties,
                                                                     e);
                      }
                  } catch (Exception userException) {
                      // Do nothing. Issue #98
                  }
              }
          }
      }
docs: Handles a failure in the Keen library. If the client is running in debug mode, this will
  immediately throw a runtime exception. Otherwise, this will log an error message and, if the
  callback is non-null, call the {@link KeenCallback#onFailure(Exception)} method. Any
  exceptions thrown by the callback are silently ignored.
  
  @param callback A callback; may be null.
  @param project         The project in which the event was published. If a default project has been set
  on the client, this parameter may be null, in which case the default project
  was used.
  @param eventCollection The name of the collection in which the event was published
  @param event           A Map that consists of key/value pairs. Keen naming conventions apply (see
  docs). Nested Maps and lists are acceptable (and encouraged!).
  @param keenProperties  A Map that consists of key/value pairs to override default properties.
  ex: "timestamp" -&gt; Calendar.getInstance()
  @param e        The exception which caused the failure.