Package org.apache.hadoop.fs.http.server
Class HttpFSExceptionProvider
java.lang.Object
org.apache.hadoop.lib.wsrs.ExceptionProvider
org.apache.hadoop.fs.http.server.HttpFSExceptionProvider
- All Implemented Interfaces:
javax.ws.rs.ext.ExceptionMapper<Throwable>
JAX-RS
ExceptionMapper implementation that maps HttpFSServer's
exceptions to HTTP status codes.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidLogs the HTTP status code and exception in HttpFSServer's log.javax.ws.rs.core.ResponsetoResponse(Throwable throwable) Maps different exceptions thrown by HttpFSServer to HTTP status codes.Methods inherited from class org.apache.hadoop.lib.wsrs.ExceptionProvider
createResponse, getOneLineMessage
-
Constructor Details
-
HttpFSExceptionProvider
public HttpFSExceptionProvider()
-
-
Method Details
-
toResponse
Maps different exceptions thrown by HttpFSServer to HTTP status codes.- SecurityException : HTTP UNAUTHORIZED
- FileNotFoundException : HTTP NOT_FOUND
- IOException : INTERNAL_HTTP SERVER_ERROR
- UnsupporteOperationException : HTTP BAD_REQUEST
- all other exceptions : HTTP INTERNAL_SERVER_ERROR
- Specified by:
toResponsein interfacejavax.ws.rs.ext.ExceptionMapper<Throwable>- Overrides:
toResponsein classExceptionProvider- Parameters:
throwable- exception thrown.- Returns:
- mapped HTTP status code
-
log
Logs the HTTP status code and exception in HttpFSServer's log.- Overrides:
login classExceptionProvider- Parameters:
status- HTTP status code.throwable- exception thrown.
-