From be2ac8d24b1dc1ca57e2dc1c3fdeb5a1b18687e9 Mon Sep 17 00:00:00 2001 From: Catherine Liu Date: Thu, 14 Nov 2024 15:25:23 -0600 Subject: [PATCH] Catch errors throw in --- src/plugins/ui_actions/public/actions/action_internal.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/ui_actions/public/actions/action_internal.ts b/src/plugins/ui_actions/public/actions/action_internal.ts index d9091551b87a1..3d0774882667f 100644 --- a/src/plugins/ui_actions/public/actions/action_internal.ts +++ b/src/plugins/ui_actions/public/actions/action_internal.ts @@ -66,7 +66,13 @@ export class ActionInternal public async isCompatible(context: Context): Promise { if (!this.definition.isCompatible) return true; - return await this.definition.isCompatible(context); + try { + return await this.definition.isCompatible(context); + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + return false; + } } public async getHref(context: Context): Promise {