public static void setControllerException(RpcController controller, IOException ioe) {
    if (controller == null) {
      return;
    }
    if (controller instanceof org.apache.hadoop.hbase.ipc.ServerRpcController) {
      ((ServerRpcController) controller).setFailedOn(ioe);
    } else {
      controller.setFailed(StringUtils.stringifyException(ioe));
    }
  }
Stores an exception encountered during RPC invocation so it can be passed back through to the
client.
@param controller the controller instance provided by the client when calling the service
@param ioe        the exception encountered
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/CoprocessorRpcUtils.java