Package org.apache.hadoop.hbase.http.log
Class LogLevelExceptionUtils
java.lang.Object
org.apache.hadoop.hbase.http.log.LogLevelExceptionUtils
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
extractValue
(String html, String regex) private static void
private static <E extends Throwable>
voidstatic void
validateResponse
(HttpURLConnection conn, int expectedStatus) Validates the status of anHttpURLConnection
against an expected HTTP status code.
-
Constructor Details
-
LogLevelExceptionUtils
public LogLevelExceptionUtils()
-
-
Method Details
-
throwEx
-
throwException
- Throws:
E extends Throwable
-
validateResponse
Validates the status of anHttpURLConnection
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
- theHttpURLConnection
.expectedStatus
- the expected HTTP status code.- Throws:
IOException
- thrown if the current status code does not match the expected one.
-
extractValue
-