Skip to content

Commit 040f2f1

Browse files
committed
Throw error if no handler for uri registered.
Signed-off-by: Thomas Mäder <[email protected]>
1 parent cb3f85b commit 040f2f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/plugin-ext/src/main/browser/uri-main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class UriMainImpl implements UriMain, Disposable {
3636

3737
this.openHandler = {
3838
id: 'theia-plugin-open-handler',
39-
canHandle: async (uri: URI, options?: OpenerOptions | undefined): Promise<number> => {
39+
canHandle: async (uri: URI, options?: OpenerOptions | undefined): Promise<number> => {
4040
if (uri.scheme !== FrontendApplicationConfigProvider.get().electron.uriScheme) {
4141
return 0;
4242
}
@@ -48,7 +48,7 @@ export class UriMainImpl implements UriMain, Disposable {
4848
},
4949
open: async (uri: URI, options?: OpenerOptions | undefined): Promise<undefined> => {
5050
if (!this.handlers.has(uri.authority)) {
51-
51+
throw new Error(`No plugin to handle this uri: : '${uri}'`);
5252
}
5353
this.proxy.$handleExternalUri(uri.toComponents());
5454
}
@@ -66,7 +66,7 @@ export class UriMainImpl implements UriMain, Disposable {
6666
this.handlers.add(pluginId);
6767
}
6868

69-
async $unregisterUriHandler(pluginId: string): Promise<void> {
69+
async $unregisterUriHandler(pluginId: string): Promise<void> {
7070
this.handlers.delete(pluginId);
7171
}
7272
}

0 commit comments

Comments
 (0)