All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quorum.tessera.api.exception.PrivacyGroupNotFoundExceptionMapper Maven / Gradle / Ivy

Go to download

Tessera is a stateless Java system that is used to enable the encryption, decryption, and distribution of private transactions for Quorum.

There is a newer version: 24.4.2
Show newest version
package com.quorum.tessera.api.exception;

import com.quorum.tessera.privacygroup.exception.PrivacyGroupNotFoundException;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Provider
public class PrivacyGroupNotFoundExceptionMapper
    implements ExceptionMapper {

  private static final Logger LOGGER =
      LoggerFactory.getLogger(PrivacyGroupNotFoundExceptionMapper.class);

  @Override
  public Response toResponse(final PrivacyGroupNotFoundException exception) {
    LOGGER.debug(null, exception);

    return Response.status(Response.Status.NOT_FOUND)
        .entity(exception.getMessage())
        .type(MediaType.TEXT_PLAIN)
        .build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy