metadata: catch std::exception instead of Exiv2::AnyError for better robustness

(cherry picked from commit 0e2d9332f633b060bd4d5cbcd9d47009bab0c46c)
This commit is contained in:
Alberto Griggio
2020-01-04 07:13:24 -08:00
committed by Lawrence Lee
parent e7fdad875a
commit e90ffe979b
6 changed files with 9 additions and 9 deletions

View File

@@ -233,7 +233,7 @@ void ExifPanel::refreshTags()
for (const auto& p : *changeList) {
try {
exif[p.first] = p.second;
} catch (const Exiv2::AnyError& exc) {
} catch (const std::exception& exc) {
}
}
@@ -258,7 +258,7 @@ void ExifPanel::refreshTags()
addTag(tag.key(), tag.tagLabel(), tag.print(&exif), false, false);
}
}
} catch (const Exiv2::AnyError& exc) {
} catch (const std::exception& exc) {
return;
}

View File

@@ -502,7 +502,7 @@ void IPTCPanel::setImageData (const FramesMetaData* id)
(*embeddedData)[tag.key()].push_back(tag.toString());
}
}
} catch (const Exiv2::AnyError& exc) {
} catch (const std::exception& exc) {
embeddedData->clear();
}
}

View File

@@ -1231,7 +1231,7 @@ void Thumbnail::saveMetadata()
std::cout << "saved edited metadata for " << fname << " to "
<< fn << std::endl;
}
} catch (Exiv2::AnyError &exc) {
} catch (std::exception &exc) {
std::cerr << "ERROR saving metadata for " << fname << " to " << fn
<< ": " << exc.what() << std::endl;
}