You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recyclarr/src/Recyclarr.TrashLib/Config/Parsing/ErrorHandling/ContextualMessages.cs

33 lines
1.2 KiB

using Recyclarr.TrashLib.Settings;
using YamlDotNet.Core;
namespace Recyclarr.TrashLib.Config.Parsing.ErrorHandling;
public static class ContextualMessages
{
public static string? GetContextualErrorFromException(YamlException e)
{
if (e.Message.Contains(
"Property 'reset_unmatched_scores' not found on type " +
$"'{typeof(QualityScoreConfigYaml).FullName}'"))
{
return
"Usage of 'reset_unmatched_scores' inside 'quality_profiles' under 'custom_formats' is no " +
"longer supported. Use the root-level 'quality_profiles' instead. " +
"See: https://recyclarr.dev/wiki/upgrade-guide/v5.0/#reset-unmatched-scores";
}
if (e.Message.Contains(
"Property 'repository' not found on type " +
$"'{typeof(SettingsValues).FullName}'"))
{
return
"Usage of 'repository' setting is no " +
"longer supported. Use 'trash_guide' under 'repositories' instead." +
"See: https://recyclarr.dev/wiki/upgrade-guide/v5.0/#settings-repository-changes";
}
return null;
}
}