Skip to content

Commit

Permalink
fix: capture "No indice_atmo_j0 found" error only for new municipalities
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudambro committed Mar 11, 2024
1 parent ff076b1 commit a1b3064
Showing 1 changed file with 51 additions and 9 deletions.
60 changes: 51 additions & 9 deletions api-node/src/getters/indice_atmo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ async function getIndiceAtmoFromMunicipalityAndDate({
});

if (indice_atmo_j0?.code_qual == null) {
capture('No indice_atmo_j0 found', {
extra: {
municipality_insee_code,
date_UTC_ISO,
},
tags: {
municipality_insee_code,
},
});
if (!missingMunicipalities.includes(municipality_insee_code)) {
capture('No indice_atmo_j0 found', {
extra: {
municipality_insee_code,
date_UTC_ISO,
},
tags: {
municipality_insee_code,
},
});
}
const indiceAtmoEmpty: Indicator = {
slug: IndicatorsSlugEnum.indice_atmospheric,
name: indicatorsObject[IndicatorsSlugEnum.indice_atmospheric].name,
Expand Down Expand Up @@ -301,6 +303,46 @@ async function getIndiceAtmoForJ1({
return null;
}

const missingMunicipalities = [
'08316',
'08248',
'02245',
'02659',
'02722',
'69152',
'02484',
'97416',
'08228',
'02389',
'02312',
'02168',
'02072',
'97407',
'02239',
'97411',
'02543',
'02358',
'02061',
'97615',
'08163',
'02824',
'02738',
'02487',
'02372',
'02238',
'02183',
'98818',
'97415',
'97311',
'08105',
'02610',
'02465',
'02340',
'02180',
'02173',
'02097',
];

export {
getIndiceAtmoFromMunicipalityAndDate,
getIndiceAtmoForJ0,
Expand Down

0 comments on commit a1b3064

Please sign in to comment.