Skip to content

Commit

Permalink
Throw error if no handler for uri registered.
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder committed Aug 27, 2024
1 parent cb3f85b commit 040f2f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-ext/src/main/browser/uri-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number> => {
canHandle: async (uri: URI, options?: OpenerOptions | undefined): Promise<number> => {
if (uri.scheme !== FrontendApplicationConfigProvider.get().electron.uriScheme) {
return 0;
}
Expand All @@ -48,7 +48,7 @@ export class UriMainImpl implements UriMain, Disposable {
},
open: async (uri: URI, options?: OpenerOptions | undefined): Promise<undefined> => {
if (!this.handlers.has(uri.authority)) {

throw new Error(`No plugin to handle this uri: : '${uri}'`);
}
this.proxy.$handleExternalUri(uri.toComponents());
}
Expand All @@ -66,7 +66,7 @@ export class UriMainImpl implements UriMain, Disposable {
this.handlers.add(pluginId);
}

async $unregisterUriHandler(pluginId: string): Promise<void> {
async $unregisterUriHandler(pluginId: string): Promise<void> {
this.handlers.delete(pluginId);
}
}

0 comments on commit 040f2f1

Please sign in to comment.