class EnclaveNotAvailableExceptionMapper implements ExceptionMapper<EnclaveNotAvailableException> {

    @Override
    public Response toResponse(final EnclaveNotAvailableException ex) {
        LOGGER.error("Enclave unavailable: {}", ex.getMessage());
        LOGGER.debug(null, ex);

        return Response.status(Status.SERVICE_UNAVAILABLE).entity(ex.getMessage()).type(MediaType.TEXT_PLAIN).build();
    }

}