mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-25 03:42:30 +00:00
Handle revision fetch failures gracefully in streamAskQuestion
This commit is contained in:
@@ -100,7 +100,11 @@ export async function streamAskQuestion({
|
||||
// Get the pages for all spaces referenced by this answer.
|
||||
const pages = await Promise.all(
|
||||
spaces.map(async (space) => {
|
||||
const revision = await spacePromises.get(space);
|
||||
const revision = await spacePromises.get(space)?.catch(() => {
|
||||
// If fetching the revision fails, we can skip the pages for this space.
|
||||
// We don't want a failure, otherwise it will break the entire answer.
|
||||
return null;
|
||||
});
|
||||
return { space, pages: revision?.pages };
|
||||
})
|
||||
).then((results) => {
|
||||
|
||||
Reference in New Issue
Block a user