From 99b515ab77e3881a089cc759e4d6d5ef3bef83b0 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 29 Aug 2023 19:20:37 -0400 Subject: [PATCH] Tuen FS exceptions into Surge errors on Startup (#7206) for the FX and ModList stuff. Closes #7205 --- src/common/SurgeStorage.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/common/SurgeStorage.cpp b/src/common/SurgeStorage.cpp index 4796a7b2b89..13132eaf992 100644 --- a/src/common/SurgeStorage.cpp +++ b/src/common/SurgeStorage.cpp @@ -516,12 +516,25 @@ SurgeStorage::SurgeStorage(const SurgeStorage::SurgeStorageConfig &config) : oth initPatchCategoryType = Surge::Storage::getUserDefaultValue( this, Surge::Storage::InitialPatchCategoryType, "Factory"); - fxUserPreset = std::make_unique(); - fxUserPreset->doPresetRescan(this); - - modulatorPreset = std::make_unique(); - modulatorPreset->forcePresetRescan(); + try + { + fxUserPreset = std::make_unique(); + fxUserPreset->doPresetRescan(this); + } + catch (fs::filesystem_error &e) + { + reportError(e.what(), "Error Scanning FX Presets"); + } + try + { + modulatorPreset = std::make_unique(); + modulatorPreset->forcePresetRescan(); + } + catch (fs::filesystem_error &e) + { + reportError(e.what(), "Error Scnning Modulator Presets"); + } memoryPools = std::make_unique(this); }