Skip to content

Commit 7aeadc3

Browse files
committed
Endre log env
1 parent 2714dbf commit 7aeadc3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

apps/endringsmelding-pleiepenger/src/app/api/endpoints/sakerEndpoint.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isUnauthorized } from '@navikt/sif-common-core-ds/src/utils/apiUtils';
12
import { getEnvironmentVariable } from '@navikt/sif-common-core-ds/src/utils/envUtils';
23
import { isK9FormatError, K9Format, K9FormatArbeidstid, K9Sak, UgyldigK9SakFormat } from '@types';
34
import {
@@ -8,9 +9,10 @@ import {
89
maskString,
910
parseK9Format,
1011
} from '@utils';
12+
import { isAxiosError } from 'axios';
13+
import { verifyK9Format } from '../../utils/verifyk9Format';
1114
import api from '../api';
1215
import { ApiEndpointInnsyn } from './';
13-
import { verifyK9Format } from '../../utils/verifyk9Format';
1416

1517
export type K9SakResult = K9Sak | UgyldigK9SakFormat;
1618

@@ -72,7 +74,11 @@ const sakerEndpoint = {
7274
});
7375
return Promise.resolve({ k9Saker, eldreSaker });
7476
} catch (error) {
75-
appSentryLogger.logInfo('sakerEndpoint.fetch failed');
77+
if (isAxiosError(error) && !isUnauthorized(error)) {
78+
appSentryLogger.logInfo(`sakerEndpoint.fetch failed - ${error.message}`);
79+
} else {
80+
appSentryLogger.logInfo('sakerEndpoint.fetch failed - unauthorized');
81+
}
7682
return Promise.reject(error);
7783
}
7884
},
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import getSentryLoggerForApp from '@navikt/sif-common-sentry';
22

3-
export const appSentryLogger = getSentryLoggerForApp('pleiepengesoknad', ['pleiepengesoknad.nav.no/dist/js']);
3+
export const appSentryLogger = getSentryLoggerForApp('endringsmelding-pleiepenger', ['endringsmelding-pleiepenger']);

packages/sif-common-sentry/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const setSentryEnvironment = (maybeHost: string | undefined): SentryEnvir
5454
if (maybeHost.indexOf('localhost') > -1) {
5555
return SentryEnvironment.LOCALHOST;
5656
}
57-
if (maybeHost.indexOf('www-q0.nav.no') > -1) {
57+
if (maybeHost.indexOf('www-q0.nav.no') > -1 || maybeHost.indexOf('intern.dev.nav.no') > -1) {
5858
return SentryEnvironment.q;
5959
}
6060
if (maybeHost.indexOf('www.nav.no') > -1) {

0 commit comments

Comments
 (0)