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 @Private public class HttpFSExceptionProvider extends ExceptionProvider
JAX-RS ExceptionMapper implementation that maps HttpFSServer's exceptions to HTTP status codes.
  • Constructor Details

    • HttpFSExceptionProvider

      public HttpFSExceptionProvider()
  • Method Details

    • 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.