From 0d9a589e08071fdd4b06d02acc5b764827228f13 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sun, 24 Aug 2014 09:20:49 +0200 Subject: [PATCH] Catch errors when enabling addons, i.e. when the addon was deleted but is still in the config --- src/addon/addon_manager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/addon/addon_manager.cpp b/src/addon/addon_manager.cpp index 7e1774691..6a6769edc 100644 --- a/src/addon/addon_manager.cpp +++ b/src/addon/addon_manager.cpp @@ -91,7 +91,14 @@ AddonManager::AddonManager(const std::string& addon_directory, { if (addon.enabled) { - enable_addon(addon.id); + try + { + enable_addon(addon.id); + } + catch(const std::exception& err) + { + log_warning << "failed to enable addon from config: " << err.what() << std::endl; + } } } } @@ -221,7 +228,7 @@ AddonManager::install_addon(const AddonId& addon_id) std::string install_filename = FileSystem::join(m_addon_directory, repository_addon.get_filename()); - m_downloader.download(repository_addon.get_http_url(), install_filename); + m_downloader.download(repository_addon.get_url(), install_filename); MD5 md5 = md5_from_file(install_filename); if (repository_addon.get_md5() != md5.hex_digest()) -- 2.11.0