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>
@Provider
@InterfaceAudience.Private
public class HttpFSExceptionProvider
- extends ExceptionProvider
JAX-RS ExceptionMapper
implementation that maps HttpFSServer's
exceptions to HTTP status codes.
Method Summary |
protected void |
log(javax.ws.rs.core.Response.Status status,
Throwable throwable)
Logs the HTTP status code and exception in HttpFSServer's log. |
javax.ws.rs.core.Response |
toResponse(Throwable throwable)
Maps different exceptions thrown by HttpFSServer to HTTP status codes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpFSExceptionProvider
public HttpFSExceptionProvider()
toResponse
public javax.ws.rs.core.Response toResponse(Throwable throwable)
- 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:
toResponse
in interface javax.ws.rs.ext.ExceptionMapper<Throwable>
- Overrides:
toResponse
in class ExceptionProvider
- Parameters:
throwable
- exception thrown.
- Returns:
- mapped HTTP status code
log
protected void log(javax.ws.rs.core.Response.Status status,
Throwable throwable)
- Logs the HTTP status code and exception in HttpFSServer's log.
- Overrides:
log
in class ExceptionProvider
- Parameters:
status
- HTTP status code.throwable
- exception thrown.
Copyright © 2014 Apache Software Foundation. All Rights Reserved.