@Nullable
  public static IOException getControllerException(RpcController controller) throws IOException {
    if (controller != null && controller.failed()) {
      if (controller instanceof ServerRpcController) {
        return ((ServerRpcController) controller).getFailedOn();
      } else {
        return new DoNotRetryIOException(controller.errorText());
      }
    }
    return null;
  }
Retreivies exception stored during RPC invocation.
@param controller the controller instance provided by the client when calling the service
@return exception if any, or null; Will return DoNotRetryIOException for string represented
        failure causes in controller.
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ResponseConverter.java