@Override
  public void preGetOp(ObserverContext<? extends RegionCoprocessorEnvironment> e, Get get,
    List<Cell> results) throws IOException {
    byte[] errorType = get.getAttribute(SHOULD_ERROR_ATTRIBUTE);
    if (errorType != null) {
      ErrorType type = ErrorType.valueOf(Bytes.toString(errorType));
      switch (type) {
        case CALL_QUEUE_TOO_BIG:
          throw new CallQueueTooBigException("Failing for test");
        case MULTI_ACTION_RESULT_TOO_LARGE:
          throw new MultiActionResultTooLarge("Failing for test");
        case FAILED_SANITY_CHECK:
          throw new FailedSanityCheckException("Failing for test");
        case NOT_SERVING_REGION:
          throw new NotServingRegionException("Failing for test");
        case REGION_MOVED:
          throw new RegionMovedException(e.getEnvironment().getServerName(), 1);
        case SCANNER_RESET:
          throw new ScannerResetException("Failing for test");
        case UNKNOWN_SCANNER:
          throw new UnknownScannerException("Failing for test");
        case REGION_TOO_BUSY:
          throw new RegionTooBusyException("Failing for test");
        case OUT_OF_ORDER_SCANNER_NEXT:
          throw new OutOfOrderScannerNextException("Failing for test");
        case QUOTA_EXCEEDED:
          throw new QuotaExceededException("Failing for test");
        case RPC_THROTTLING:
          throw new RpcThrottlingException("Failing for test");
        case CALL_DROPPED:
          throw new CallDroppedException("Failing for test");
        default:
          throw new DoNotRetryIOException("Failing for test");
      }
    }
  }
Simple test coprocessor for injecting exceptions on Get requests.
hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.java