Class JakartaNotFoundExceptionMapper

java.lang.Object
uk.co.jasonmarston.kiunzi.utility.exception.mapper.JakartaNotFoundExceptionMapper
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<jakarta.ws.rs.NotFoundException>

@Provider public class JakartaNotFoundExceptionMapper extends Object implements jakarta.ws.rs.ext.ExceptionMapper<jakarta.ws.rs.NotFoundException>
Maps Jakarta REST NotFoundException instances to HTTP 404 responses.

This mapper covers routing-level or resource-level not-found conditions raised by the Jakarta REST runtime.

See Also:
  • Constructor Details

    • JakartaNotFoundExceptionMapper

      public JakartaNotFoundExceptionMapper()
      Creates a mapper for Jakarta REST not-found exceptions.
  • Method Details

    • toResponse

      public jakarta.ws.rs.core.Response toResponse(jakarta.ws.rs.NotFoundException ex)
      Converts the supplied Jakarta REST not-found exception into an HTTP response.
      Specified by:
      toResponse in interface jakarta.ws.rs.ext.ExceptionMapper<jakarta.ws.rs.NotFoundException>
      Parameters:
      ex - the Jakarta REST not-found exception raised while processing the request
      Returns:
      an HTTP 404 response containing an ErrorResponse body