diff --git a/Src/RandomizerTMF.Logic/Services/RandomizerConfig.cs b/Src/RandomizerTMF.Logic/Services/RandomizerConfig.cs index 9c076cd..bc871a1 100644 --- a/Src/RandomizerTMF.Logic/Services/RandomizerConfig.cs +++ b/Src/RandomizerTMF.Logic/Services/RandomizerConfig.cs @@ -97,16 +97,18 @@ public static RandomizerConfig GetOrCreate(ILogger logger, IFileSystem fileSyste catch (YamlException ex) { logger.LogWarning(ex.InnerException, "Error while deserializing the config file ({configPath}; [{start}] - [{end}]).", Constants.ConfigYml, ex.Start, ex.End); + throw new Exception("Config file is corrupted or incorrectly formatted."); } catch (Exception ex) { logger.LogWarning(ex, "Error while deserializing the config file ({configPath}).", Constants.ConfigYml); + throw new Exception("Config file is corrupted or there's another problem."); } } if (config is null) { - logger.LogInformation("Config file not found or is corrupted, creating a new one..."); + logger.LogInformation("Config file not found, creating a new one..."); config = new RandomizerConfig(logger, fileSystem); }