Replaced all hardcoded error codes with ker... constants

This commit is contained in:
Dan Čermák
2018-02-16 00:26:50 +01:00
parent d897997b29
commit efe2ccdcb6
80 changed files with 747 additions and 747 deletions
+6 -6
View File
@@ -78,7 +78,7 @@ bool processLine(const std::string& line, int num, IptcData &iptcData)
default:
std::ostringstream os;
os << "Unknown command (" << line.at(0) << ") at line " << num;
throw Error(1, os.str());
throw Error(kerErrorMessage, os.str());
}
return true;
}
@@ -94,7 +94,7 @@ void processAdd(const std::string& line, int num, IptcData &iptcData)
dataStart == std::string::npos) {
std::ostringstream os;
os << "Invalid \'a\' command at line " << num;
throw Error(1, os.str());
throw Error(kerErrorMessage, os.str());
}
std::string key(line.substr(keyStart, keyEnd-keyStart));
@@ -111,7 +111,7 @@ void processAdd(const std::string& line, int num, IptcData &iptcData)
int rc = iptcData.add(iptcKey, value.get());
if (rc) {
throw Error(1, "Iptc dataset already exists and is not repeatable");
throw Error(kerErrorMessage, "Iptc dataset already exists and is not repeatable");
}
}
@@ -122,7 +122,7 @@ void processRemove(const std::string& line, int num, IptcData &iptcData)
if (keyStart == std::string::npos) {
std::ostringstream os;
os << "Invalid \'r\' command at line " << num;
throw Error(1, os.str());
throw Error(kerErrorMessage, os.str());
}
const std::string key( line.substr(keyStart) );
@@ -145,7 +145,7 @@ void processModify(const std::string& line, int num, IptcData &iptcData)
dataStart == std::string::npos) {
std::ostringstream os;
os << "Invalid \'m\' command at line " << num;
throw Error(1, os.str());
throw Error(kerErrorMessage, os.str());
}
std::string key(line.substr(keyStart, keyEnd-keyStart));
@@ -167,7 +167,7 @@ void processModify(const std::string& line, int num, IptcData &iptcData)
else {
int rc = iptcData.add(iptcKey, value.get());
if (rc) {
throw Error(1, "Iptc dataset already exists and is not repeatable");
throw Error(kerErrorMessage, "Iptc dataset already exists and is not repeatable");
}
}
}