Class LogLevelExceptionUtils

java.lang.Object
org.apache.hadoop.hbase.http.log.LogLevelExceptionUtils

@Private public class LogLevelExceptionUtils extends Object
HTTP utility class to help propagate server side exception in log level servlet to the client over HTTP (HTML payload) It parses HTTP client connections and recreates the exception.
  • Constructor Details

  • Method Details

    • throwEx

      private static void throwEx(Throwable ex)
    • throwException

      private static <E extends Throwable> void throwException(Throwable ex) throws E
      Throws:
      E extends Throwable
    • validateResponse

      public static void validateResponse(HttpURLConnection conn, int expectedStatus) throws IOException
      Validates the status of an HttpURLConnection against an expected HTTP status code. If the current status code is not the expected one it throws an exception with a detail message using Server side error messages if available.

      NOTE: This is an adapted version of the original method in HttpServerUtil.java of Hadoop, but we handle for HTML response.

      Parameters:
      conn - the HttpURLConnection.
      expectedStatus - the expected HTTP status code.
      Throws:
      IOException - thrown if the current status code does not match the expected one.
    • extractValue

      private static String extractValue(String html, String regex)