Skip to content

Commit

Permalink
fix: trombi don't crash when error in format orga
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine D committed Nov 28, 2024
1 parent 0d598fb commit ecf3654
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/operations/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,16 @@ export const fetchOrgas = async (): Promise<Orga[]> => {
},
},
});
return orgas.map((orga) => {
// log the orga to see what it looks like
logger.debug(`Format de l'orga : ${orga.username}`);
logger.debug(orga);
logger.debug(orga.id);
logger.debug(orga.orga);
const formattedOrga = formatOrga(orga);
return formattedOrga;
});
return orgas
.map((orga) => {
try {
return formatOrga(orga);
} catch (error) {
logger.error(`Error while formatting orga ${orga.id}`, error);
return null;
}
})
.filter((orga) => orga !== null);
};

export const createUser = async (user: {
Expand Down

0 comments on commit ecf3654

Please sign in to comment.