From ac9c2696eca71f363cce745f71657db66d97eca4 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 11 Jul 2022 13:51:04 +0200 Subject: [PATCH] Plugspace robustness improvement --- packages/server/hooks/plug_space_primitives.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/server/hooks/plug_space_primitives.ts b/packages/server/hooks/plug_space_primitives.ts index 5fb01b9..4dc7951 100644 --- a/packages/server/hooks/plug_space_primitives.ts +++ b/packages/server/hooks/plug_space_primitives.ts @@ -29,8 +29,12 @@ export class PlugSpacePrimitives implements SpacePrimitives { let allPages = new Set(); for (let { plug, name, operation } of this.hook.spaceFunctions) { if (operation === "listPages") { - for (let pm of await plug.invoke(name, [])) { - allPages.add(pm); + try { + for (let pm of await plug.invoke(name, [])) { + allPages.add(pm); + } + } catch (e) { + console.error("Error listing pages", e); } } }