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 // finally set the values
try { try {
if (!convertedValues.empty() || convertedId3v2CoverValues.empty()) { if ((!convertedValues.empty() || convertedId3v2CoverValues.empty())
denotedScope.field.setValues(tag, tagType, convertedValues); && !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) { } catch (const ConversionException &e) {
diag.emplace_back(DiagLevel::Critical, diag.emplace_back(DiagLevel::Critical,