diff --git a/src/operations/user.ts b/src/operations/user.ts index 677dac84..b319cfb9 100644 --- a/src/operations/user.ts +++ b/src/operations/user.ts @@ -258,7 +258,16 @@ export const fetchOrgas = async (): Promise => { }, }, }); - return orgas.map(formatOrga); + 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: {