Skip to content

Commit

Permalink
Give visibility to Algolia error message (#3126)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarvarela authored Sep 25, 2024
1 parent 9d20ddb commit d315277
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions site/gatsby-site/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,19 +334,23 @@ exports.onPreBootstrap = async ({ reporter }) => {

translationsActivity.setStatus('Updating incidents indexes...');

const algoliaClient = algoliasearch(
config.header.search.algoliaAppId,
config.header.search.algoliaAdminKey
);

const algoliaUpdater = new AlgoliaUpdater({
languages,
mongoClient,
algoliaClient,
reporter,
});

await algoliaUpdater.run();
try {
const algoliaClient = algoliasearch(
config.header.search.algoliaAppId,
config.header.search.algoliaAdminKey
);

const algoliaUpdater = new AlgoliaUpdater({
languages,
mongoClient,
algoliaClient,
reporter,
});

await algoliaUpdater.run();
} catch (e) {
reporter.panicOnBuild('Error updating Algolia index:', e);
}
} else {
throw `Missing environment variable, can't run translation process.`;
}
Expand Down

0 comments on commit d315277

Please sign in to comment.