diff --git a/src/components/DocumentView/Integration/IntegrationBlock.tsx b/src/components/DocumentView/Integration/IntegrationBlock.tsx index 41f985f52..6eb91d1e9 100644 --- a/src/components/DocumentView/Integration/IntegrationBlock.tsx +++ b/src/components/DocumentView/Integration/IntegrationBlock.tsx @@ -74,6 +74,7 @@ export async function IntegrationBlock(props: BlockProps(promise: Promise): Promise { +export async function ignoreAPIError( + promise: Promise, + ignoreAll: boolean = false, +): Promise { try { return await promise; } catch (error) { const code = (error as GitBookAPIError).code; - if (code >= 400 && code < 500) { + if (ignoreAll || (code >= 400 && code < 500)) { return null; }