Skip to content

Commit

Permalink
overlat til klienten å logge
Browse files Browse the repository at this point in the history
  • Loading branch information
janolaveide committed Feb 8, 2021
1 parent d259c91 commit 203634b
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLError;

import no.nav.vedtak.exception.IntegrasjonException;
import no.nav.vedtak.felles.integrasjon.graphql.GraphQLErrorHandler;

public class PdlDefaultErrorHandler implements GraphQLErrorHandler {
Expand All @@ -32,7 +31,6 @@ public class PdlDefaultErrorHandler implements GraphQLErrorHandler {

@Override
public <T> T handleError(List<GraphQLError> errors, URI uri, String kode) {
LOG.warn("PDL oppslag mot {} returnerte {} feil", uri, errors.size());
throw errors
.stream()
.findFirst() // TODO hva med flere?
Expand All @@ -53,7 +51,7 @@ private static PDLExceptionExtension details(Map<String, Object> details) {

}

private static IntegrasjonException exception(List<GraphQLError> errors, PDLExceptionExtension extension, URI uri) {
private static PdlException exception(List<GraphQLError> errors, PDLExceptionExtension extension, URI uri) {
if (extension == null) {
return exceptionFra(errors, SC_INTERNAL_SERVER_ERROR, PDL_INTERNAL, extension, uri);
}
Expand All @@ -71,11 +69,11 @@ private static IntegrasjonException exception(List<GraphQLError> errors, PDLExce
}
}

private static IntegrasjonException exceptionFra(List<GraphQLError> errors, int status, PDLExceptionExtension extension, URI uri) {
private static PdlException exceptionFra(List<GraphQLError> errors, int status, PDLExceptionExtension extension, URI uri) {
return exceptionFra(errors, status, PDL_ERROR_RESPONSE, extension, uri);
}

private static IntegrasjonException exceptionFra(List<GraphQLError> errors, int status, String kode, PDLExceptionExtension extension, URI uri) {
private static PdlException exceptionFra(List<GraphQLError> errors, int status, String kode, PDLExceptionExtension extension, URI uri) {
return new PdlException(kode, errors, extension, status, uri);

}
Expand Down

0 comments on commit 203634b

Please # to comment.