Class UnauthorizedExceptionMapper
java.lang.Object
ch.tocco.nice2.rest.core.spi.error.UnauthorizedExceptionMapper
- All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<UnauthorizedException>
@Component
public class UnauthorizedExceptionMapper
extends Object
implements jakarta.ws.rs.ext.ExceptionMapper<UnauthorizedException>
Maps
UnauthorizedException
to a response.
If the user is authenticated, status 403 FORBIDDEN is returned.
If the user is not authenticated, status 401 UNAUTHORIZED is returned.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
toResponse
(UnauthorizedException exception)
-
Constructor Details
-
UnauthorizedExceptionMapper
public UnauthorizedExceptionMapper(org.slf4j.Logger log)
-
-
Method Details
-
toResponse
- Specified by:
toResponse
in interfacejakarta.ws.rs.ext.ExceptionMapper<UnauthorizedException>
-