Class PageNotFoundExceptionMapper

java.lang.Object
io.extact.rms.platform.jaxrs.mapper.PageNotFoundExceptionMapper
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<jakarta.ws.rs.NotFoundException>

@Produces("application/json") public class PageNotFoundExceptionMapper extends Object implements jakarta.ws.rs.ext.ExceptionMapper<jakarta.ws.rs.NotFoundException>
Handle NotFoundException that occurs when status code is 404. The handle of unknown RuntimeException logs stacktrace, but I don't want to output stacktrace with 404, so NotFoundException is handled individually.
  • Constructor Details

    • PageNotFoundExceptionMapper

      @Inject public PageNotFoundExceptionMapper(org.eclipse.microprofile.config.Config config)
  • Method Details

    • toResponse

      public jakarta.ws.rs.core.Response toResponse(jakarta.ws.rs.NotFoundException exception)
      Static content registered in the configuration file does not handle anything.
      Specified by:
      toResponse in interface jakarta.ws.rs.ext.ExceptionMapper<jakarta.ws.rs.NotFoundException>
      Parameters:
      exception - Occurrence exception
      Returns:
      Response