remove templating & simplify error message

+ clang-format in Error files
+ Remove AnyError
This commit is contained in:
Luis Díaz Más
2022-03-08 19:52:21 +01:00
committed by Luis Diaz
parent 96f7f2e4c5
commit 7119b7676f
37 changed files with 288 additions and 351 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -102,7 +102,7 @@ int main(int argc,const char** argv)
httpcon(url, useHttp1_0);
isOk = true;
}
} catch (const Exiv2::AnyError& e) {
} catch (const Exiv2::Error& e) {
std::cout << "Error: '" << e << "'" << std::endl;
return -1;
}
+1 -1
View File
@@ -34,7 +34,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -81,7 +81,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -49,7 +49,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -88,7 +88,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -198,7 +198,7 @@ int main(int argc,const char* argv[])
result = 3;
break;
}
} catch (Exiv2::AnyError& e) {
} catch (Exiv2::Error& e) {
std::cerr << "*** error exiv2 exception '" << e << "' ***" << std::endl;
result = 4;
} catch ( ... ) {
+1 -1
View File
@@ -118,7 +118,7 @@ try {
return rc;
}
//catch (std::exception& e) {
//catch (Exiv2::AnyError& e) {
//catch (Exiv2::Error& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e.what() << "'\n";
return -1;
+1 -1
View File
@@ -32,7 +32,7 @@ int main(int argc, char* const argv[])
try {
std::cout << exifData[key] << std::endl;
} catch (Exiv2::AnyError& e) {
} catch (Exiv2::Error& e) {
std::cerr << "Caught Exiv2 exception '" << e << "'" << std::endl;
exit(3);
} catch ( ... ) {
+1 -1
View File
@@ -137,7 +137,7 @@ int main(int argc, char* const argv[])
}
return 0;
} catch (Exiv2::AnyError& e) {
} catch (Exiv2::Error& e) {
std::cerr << "Caught Exiv2 exception '" << e << "'\n";
return 20;
}
+1 -1
View File
@@ -44,7 +44,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -45,7 +45,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return 1;
}
+1 -1
View File
@@ -45,7 +45,7 @@ int main(int argc, char* const argv[])
return 0;
}
catch (AnyError& e) {
catch (Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -72,7 +72,7 @@ int main(int argc, char* const argv[])
image->writeMetadata();
return 0;
} catch (Exiv2::AnyError& e) {
} catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+2 -2
View File
@@ -57,7 +57,7 @@ try {
try {
writeImg->writeMetadata();
}
catch (const Exiv2::AnyError&) {
catch (const Exiv2::Error&) {
std::cerr << params.progname() <<
": Could not write metadata to (" << params.write_ << ")\n";
return 8;
@@ -65,7 +65,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cerr << "Caught Exiv2 exception '" << e << "'\n";
return 10;
}
+1 -1
View File
@@ -39,6 +39,6 @@ try {
return 0;
}
catch (const AnyError& e) {
catch (const Error& e) {
std::cout << e << "\n";
}
+1 -1
View File
@@ -46,7 +46,7 @@ int main(int argc, char* const argv[])
}
return 0;
} catch (Exiv2::AnyError& e) {
} catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -38,7 +38,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -101,7 +101,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -80,7 +80,7 @@ int main()
std::cout << "nok";
std::cout << std::endl;
} catch (Exiv2::AnyError& e) {
} catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+2 -2
View File
@@ -76,7 +76,7 @@ int main(int argc, char* argv[])
try {
XmpProperties::printProperties(std::cout, item);
break;
} catch (const AnyError&) {
} catch (const Error&) {
rc = 2;
}
std::cerr << "Unexpected argument " << argv[1] << std::endl;
@@ -135,7 +135,7 @@ int main(int argc, char* argv[])
<< "Print Exif tags, MakerNote tags, or Iptc datasets" << std::endl
;
}
} catch (AnyError& e) {
} catch (Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
rc = EXIT_FAILURE ;
}
+1 -1
View File
@@ -35,7 +35,7 @@ try {
return 0;
}
catch (const AnyError& e) {
catch (const Error& e) {
std::cout << e << "\n";
}
+1 -1
View File
@@ -132,7 +132,7 @@ int main(int argc, char* const argv[])
return rc;
}
catch (AnyError& e) {
catch (Error& e) {
std::cerr << "Caught Exiv2 exception '" << e << "'\n";
return 1;
}
+1 -1
View File
@@ -189,7 +189,7 @@ int main(int argc, char* const argv[])
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -30,7 +30,7 @@ int main(int argc, char* const argv[])
std::cout << xmpPacket << "\n";
return 0;
} catch (Exiv2::AnyError& e) {
} catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -39,7 +39,7 @@ try {
Exiv2::XmpParser::terminate();
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -54,7 +54,7 @@ try {
Exiv2::XmpParser::terminate();
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
+1 -1
View File
@@ -49,7 +49,7 @@ int main(int argc, char** argv)
return 0;
}
catch (Exiv2::AnyError& e)
catch (Exiv2::Error& e)
{
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
+1 -1
View File
@@ -205,7 +205,7 @@ try {
return 0;
}
catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}