Package net.spy.memcached.ops

Examples of net.spy.memcached.ops.OperationException


  protected void handleError(OperationErrorType eType, String line)
    throws IOException {
    getLogger().error("Error:  %s", line);
    switch(eType) {
      case GENERAL:
        exception=new OperationException();
        break;
      case SERVER:
        exception=new OperationException(eType, line);
        break;
      case CLIENT:
        exception=new OperationException(eType, line);
        break;
      default: assert false;
    }
    transitionState(OperationState.COMPLETE);
    throw exception;
View Full Code Here


  protected void handleError(OperationErrorType eType, String line)
    throws IOException {
    getLogger().error("Error:  %s", line);
    switch(eType) {
      case GENERAL:
        exception=new OperationException();
        break;
      case SERVER:
        exception=new OperationException(eType, line);
        break;
      case CLIENT:
        exception=new OperationException(eType, line);
        break;
      default: assert false;
    }
    transitionState(OperationState.COMPLETE);
    throw exception;
View Full Code Here

      ((ViewCallback) callback).gotData(vr);
      callback.receivedStatus(status);
    } catch (ParseException e) {
      LOGGER.error("Failed to parse JSON in response: " + response + ": " + json);
      setException(new OperationException(OperationErrorType.GENERAL,
        "Error parsing JSON (" + e.getMessage() + "): " + json));
    }
    callback.complete();
  }
View Full Code Here

  protected String getEntityString(HttpResponse response) {
    if (!isTimedOut() && !hasErrored() && !isCancelled()) {
      try {
        return EntityUtils.toString(response.getEntity());
      } catch (org.apache.http.ParseException e) {
        exception = new OperationException(OperationErrorType.GENERAL,
          "Bad http headers");
        errored = true;
      } catch (IOException e) {
        exception = new OperationException(OperationErrorType.GENERAL,
          "Error reading response");
        errored = true;
      } catch (IllegalArgumentException e) {
        exception = new OperationException(OperationErrorType.GENERAL,
          "No entity");
        errored = true;
      }
    }
    return null;
View Full Code Here

      }

      ((ViewCallback) callback).gotData(vr);
      callback.receivedStatus(status);
    } catch (ParseException e) {
      setException(new OperationException(OperationErrorType.GENERAL,
          "Error parsing JSON"));
    }
    callback.complete();
  }
View Full Code Here

TOP

Related Classes of net.spy.memcached.ops.OperationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.