Module utility.exception.mapper
Class NotFoundExceptionMapper
java.lang.Object
uk.co.jasonmarston.kiunzi.utility.exception.mapper.NotFoundExceptionMapper
- All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<uk.co.jasonmarston.kiunzi.utility.domain.exception.NotFoundException>
@Provider
public class NotFoundExceptionMapper
extends Object
implements jakarta.ws.rs.ext.ExceptionMapper<uk.co.jasonmarston.kiunzi.utility.domain.exception.NotFoundException>
Maps domain
NotFoundException instances to HTTP 404 responses.
This mapper is used when the requested domain resource cannot be found by the underlying use case.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsetoResponse(uk.co.jasonmarston.kiunzi.utility.domain.exception.NotFoundException ex) Converts the supplied domain not-found exception into an HTTP response.
-
Constructor Details
-
NotFoundExceptionMapper
public NotFoundExceptionMapper()Creates a mapper for domain not-found exceptions.
-
-
Method Details
-
toResponse
public jakarta.ws.rs.core.Response toResponse(uk.co.jasonmarston.kiunzi.utility.domain.exception.NotFoundException ex) Converts the supplied domain not-found exception into an HTTP response.- Specified by:
toResponsein interfacejakarta.ws.rs.ext.ExceptionMapper<uk.co.jasonmarston.kiunzi.utility.domain.exception.NotFoundException>- Parameters:
ex- the domain not-found exception raised while processing the request- Returns:
- an HTTP 404 response containing an
ErrorResponsebody
-