Improve error handling when setting tags in CLI

This commit is contained in:
Martchus 2022-08-12 00:28:57 +02:00
parent 04a09c025c
commit 08629ef4ee
1 changed files with 4 additions and 2 deletions

View File

@ -782,8 +782,10 @@ void setTagInfo(const SetTagInfoArgs &args)
}
// finally set the values
try {
if (!convertedValues.empty() || convertedId3v2CoverValues.empty()) {
denotedScope.field.setValues(tag, tagType, convertedValues);
if ((!convertedValues.empty() || convertedId3v2CoverValues.empty())
&& !denotedScope.field.setValues(tag, tagType, convertedValues)) {
diag.emplace_back(DiagLevel::Critical,
argsToString("Unable set field \"", denotedScope.field.name(), "\": setting field is not supported"), context);
}
} catch (const ConversionException &e) {
diag.emplace_back(DiagLevel::Critical,