code: private void handleFailure(KeenCallback callback, Exception e) {
          if (isDebugMode) {
              if (e instanceof RuntimeException) {
                  throw (RuntimeException) e;
              } else {
                  throw new RuntimeException(e);
              }
          } else {
              KeenLogging.log("Encountered error: " + e.getMessage());
              if (callback != null) {
                  try {
                      callback.onFailure(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 e        The exception which caused the failure.