mirror of
https://github.com/WowUp/WowUp.git
synced 2026-04-23 23:37:11 -04:00
Catch an error if an addon provider is not found for a url
This commit is contained in:
@@ -97,8 +97,6 @@ export class InstallFromUrlDialogComponent implements OnInit, OnDestroy {
|
||||
|
||||
try {
|
||||
const importedAddon = await this._addonService.getAddonByUrl(url, this._sessionService.selectedClientType);
|
||||
|
||||
console.debug(importedAddon);
|
||||
if (!importedAddon) {
|
||||
throw new Error("Addon not found");
|
||||
}
|
||||
|
||||
@@ -517,8 +517,12 @@ export class AddonService {
|
||||
return this._addonStorage.get(addonId);
|
||||
}
|
||||
|
||||
public async getAddonByUrl(url: URL, clientType: WowClientType) {
|
||||
public async getAddonByUrl(url: URL, clientType: WowClientType): Promise<AddonSearchResult | undefined> {
|
||||
const provider = this.getAddonProvider(url);
|
||||
if (!provider) {
|
||||
console.warn(`No provider found for urlL: ${url}`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return await provider.searchByUrl(url, clientType);
|
||||
}
|
||||
@@ -766,7 +770,7 @@ export class AddonService {
|
||||
addon.externalIds = externalIds;
|
||||
}
|
||||
|
||||
private reconcileUnmatchedAddons(addon: Addon) {}
|
||||
private reconcileUnmatchedAddons(addon: Addon) { }
|
||||
|
||||
/**
|
||||
* This should verify that a folder that did not have a match, is actually unmatched
|
||||
|
||||
Reference in New Issue
Block a user