From 040f2f1135f8a65712fa0f9c5fac31668c5f8923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Tue, 27 Aug 2024 17:05:05 +0200 Subject: [PATCH] Throw error if no handler for uri registered. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- packages/plugin-ext/src/main/browser/uri-main.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/plugin-ext/src/main/browser/uri-main.ts b/packages/plugin-ext/src/main/browser/uri-main.ts index 14bb9fc77d5de..6e18cdea5241c 100644 --- a/packages/plugin-ext/src/main/browser/uri-main.ts +++ b/packages/plugin-ext/src/main/browser/uri-main.ts @@ -36,7 +36,7 @@ export class UriMainImpl implements UriMain, Disposable { this.openHandler = { id: 'theia-plugin-open-handler', - canHandle: async (uri: URI, options?: OpenerOptions | undefined): Promise => { + canHandle: async (uri: URI, options?: OpenerOptions | undefined): Promise => { if (uri.scheme !== FrontendApplicationConfigProvider.get().electron.uriScheme) { return 0; } @@ -48,7 +48,7 @@ export class UriMainImpl implements UriMain, Disposable { }, open: async (uri: URI, options?: OpenerOptions | undefined): Promise => { if (!this.handlers.has(uri.authority)) { - + throw new Error(`No plugin to handle this uri: : '${uri}'`); } this.proxy.$handleExternalUri(uri.toComponents()); } @@ -66,7 +66,7 @@ export class UriMainImpl implements UriMain, Disposable { this.handlers.add(pluginId); } - async $unregisterUriHandler(pluginId: string): Promise { + async $unregisterUriHandler(pluginId: string): Promise { this.handlers.delete(pluginId); } }