From 08629ef4eeaa648afa7042f83e8e59130f17fe89 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 12 Aug 2022 00:28:57 +0200 Subject: [PATCH] Improve error handling when setting tags in CLI --- cli/mainfeatures.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/mainfeatures.cpp b/cli/mainfeatures.cpp index d85a4da..25c7f62 100644 --- a/cli/mainfeatures.cpp +++ b/cli/mainfeatures.cpp @@ -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,