Package org.kiwiproject.jaxrs.exception
Class NoSuchElementExceptionMapper
java.lang.Object
org.kiwiproject.jaxrs.exception.NoSuchElementExceptionMapper
- All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<NoSuchElementException>
public class NoSuchElementExceptionMapper
extends Object
implements jakarta.ws.rs.ext.ExceptionMapper<NoSuchElementException>
Map
NoSuchElementException to Response.
The mapped response has status code 404 (Bad Request) and media type JSON.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsetoResponse(NoSuchElementException exception) Convert the givenNoSuchElementExceptionto a 404 Not Found response containing a JSON entity.
-
Constructor Details
-
NoSuchElementExceptionMapper
public NoSuchElementExceptionMapper()
-
-
Method Details
-
toResponse
Convert the givenNoSuchElementExceptionto a 404 Not Found response containing a JSON entity.- Specified by:
toResponsein interfacejakarta.ws.rs.ext.ExceptionMapper<NoSuchElementException>- Parameters:
exception- the exception to convert- Returns:
- a response
- See Also:
-