public static boolean isError(Map obj) {
    return (obj != null) && obj.containsKey("error");
  }
Check if this is an error doc.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/JsonBuilder.java