Skip to content

Commit

Permalink
Endre prefiks for feilmeldinger til k9
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenoosvik committed Feb 5, 2025
1 parent cf76773 commit 7a437a7
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public List<ArbeidsforholdDto> finnArbeidsforholdForArbeidstaker(String personId
}

if (response.statusCode() >= 400) {
throw new IntegrasjonException("FP-12345", "Feil ved henting av arbeidsforhold for person: " + response.body());
throw new IntegrasjonException("K9-12345", "Feil ved henting av arbeidsforhold for person: " + response.body());
}

var arbeidsforhold = DefaultJsonMapper.fromJson(response.body(), ArbeidsforholdDto[].class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean harTilgangTilBedriften(String orgnr) {
try {
return restClient.sendReturnList(request, AltinnReportee.class);
} catch (RuntimeException e) {
throw new IntegrasjonException("FP-965432",
throw new IntegrasjonException("K9-965432",
"Feil ved kall til altinn-rettigheter-proxy. Meld til #team_fager hvis dette skjer over lengre tidsperiode.", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public byte[] genererPdf(InntektsmeldingPdfData dokumentdata) throws URISyntaxEx
var pdf = restClient.sendReturnByteArray(request);

if (pdf == null || pdf.length == 0) {
throw new TekniskException("FPIM", "Fikk tomt svar ved kall til dokgen for generering av pdf for inntektsmelding");
throw new TekniskException("K9IM", "Fikk tomt svar ved kall til dokgen for generering av pdf for inntektsmelding");
}
return pdf;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private byte[] genererPdf(InntektsmeldingPdfData imDokumentData, int inntektsmel
} catch (Exception e) {
imDokumentData.anonymiser();
SECURE_LOG.warn("Klarte ikke å generere pdf av inntektsmelding: {}", DefaultJsonMapper.toJson(imDokumentData));
throw new TekniskException("FPINNTEKTSMELDING_1",
throw new TekniskException("K9INNTEKTSMELDING_1",
String.format("Klarte ikke å generere pdf for inntektsmelding med id %s", inntektsmeldingId), e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private Inntektsopplysninger lagTomRespons(LocalDate skjæringstidspunkt, String
var månedsinntekter = inntekter.stream().map(i -> mapInntektMedStatus(i, dagensDato)).toList();
var antallMndMedRapportertInntekt = månedsinntekter.stream().filter(m -> m.beløp() != null).count();
if (antallMndMedRapportertInntekt > 3) {
throw new TekniskException("FPINNTEKTSMELDING_INNTEKTKSKOMPONENT_1",
throw new TekniskException("K9INNTEKTSMELDING_INNTEKTKSKOMPONENT_1",
String.format("Har mappet flere enn 3 måneder med inntekt, ugyldig tilstand. Mappede månedsinntekter var %s", månedsinntekter));
}
var totalLønn = månedsinntekter.stream()
Expand Down Expand Up @@ -152,7 +152,7 @@ private boolean rapporteringsfristErPassert(LocalDate dato, LocalDate dagensDato

private List<Månedsinntekt> oversettRespons(HentInntektListeBolkResponse response, AktørIdEntitet aktørId, String organisasjonsnummer) {
if (response.getSikkerhetsavvikListe() != null && !response.getSikkerhetsavvikListe().isEmpty()) {
throw new IntegrasjonException("FP-535194",
throw new IntegrasjonException("K9-535194",
String.format("Fikk følgende sikkerhetsavvik ved kall til inntektstjenesten: %s.", byggSikkerhetsavvikString(response)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public HentInntektListeBolkResponse finnInntekt(FinnInntektRequest finnInntektRe
try {
response = restClient.send(request, HentInntektListeBolkResponse.class);
} catch (RuntimeException e) {
throw new IntegrasjonException("FP-824246",
throw new IntegrasjonException("K9-824246",
"Feil ved kall til inntektstjenesten. Meld til #team_registre og #produksjonshendelser hvis dette skjer over lengre tidsperiode.", e);
}
return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static void loggInnsendtInntektsmelding(InntektsmeldingEntitet inntektsme
}

private static void loggFeil(Exception e, String metodekall) {
String msg = String.format("FPINNTEKTSMELDING_METRIKKER_1: Feil ved generering av metrikker i metode %s, fikk feilmelding %s", metodekall, e);
String msg = String.format("K9INNTEKTSMELDING_METRIKKER_1: Feil ved generering av metrikker i metode %s, fikk feilmelding %s", metodekall, e);
LOG.warn(msg);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void skal_returnere_tom_liste_ved_ingen_arbeidsforhold() {
var ident = "12345678901";

when(restClient.sendReturnUnhandled(any(RestRequest.class)))
.thenThrow(new IntegrasjonException("FP-12345", "404 feil"));
.thenThrow(new IntegrasjonException("K9-12345", "404 feil"));

// Act
var result = aaregRestKlient.finnArbeidsforholdForArbeidstaker(ident, LocalDate.now());
Expand All @@ -126,7 +126,7 @@ void skal_returnere_tom_liste_ved_ingen_arbeidsforhold() {
var ident = "12345678901";

when(restClient.sendReturnUnhandled(any(RestRequest.class)))
.thenThrow(new IntegrasjonException("FP-w00t", "Ukjent feil"));
.thenThrow(new IntegrasjonException("K9-w00t", "Ukjent feil"));

assertThrows(IntegrasjonException.class, () -> aaregRestKlient.finnArbeidsforholdForArbeidstaker(ident, LocalDate.now()));
}
Expand Down

0 comments on commit 7a437a7

Please sign in to comment.