private static String parseErrorJSON(JsonObject resp) {
		Object errorObj = resp.get("error");
		if (errorObj instanceof String) {
			return (String) errorObj;
		}
		if (!(errorObj instanceof JsonObject err)) {
			return "Unknown error format";
		}

		String typeString = convertToString(err.get("type"), "Unknown Error");
		if (typeString.endsWith("_exception")) {
			// Log elastic exception root cause to assist debug
			String errorDetail = parseErrorCause(err);
			if (errorDetail.length() != 0) {
				Msg.error(ElasticConnection.class, "Elasticsearch exception: " + errorDetail);
			}
		}

		String reasonString = convertToString(err.get("reason"), "Unknown Reason");
		return typeString + " : " + reasonString;
	}
Elastic search sends a JSON document in the Http error stream for any error
Pull out relevant info from the document and construct an exception message
@param resp is the parsed error document
@return the exception String
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticConnection.java