Module utility.exception.mapper
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 Summary
ConstructorsConstructorDescriptionCreates a mapper for Jakarta REST not-found exceptions. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsetoResponse(jakarta.ws.rs.NotFoundException ex) Converts the supplied Jakarta REST not-found exception into an HTTP response.
-
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:
toResponsein interfacejakarta.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
ErrorResponsebody
-