metadata: catch std::exception instead of Exiv2::AnyError for better robustness
(cherry picked from commit 0e2d9332f633b060bd4d5cbcd9d47009bab0c46c)
This commit is contained in:
committed by
Lawrence Lee
parent
e7fdad875a
commit
e90ffe979b
@@ -185,7 +185,7 @@ void Exiv2Metadata::do_merge_xmp(Exiv2::Image *dst) const
|
||||
for (auto &datum : xmp) {
|
||||
dst->xmpData()[datum.key()] = datum;
|
||||
}
|
||||
} catch (Exiv2::AnyError &exc) {
|
||||
} catch (std::exception &exc) {
|
||||
if (settings->verbose) {
|
||||
std::cerr << "Error loading metadata from XMP sidecar: "
|
||||
<< exc.what() << std::endl;
|
||||
@@ -240,7 +240,7 @@ void Exiv2Metadata::import_exif_pairs(Exiv2::ExifData &out) const
|
||||
for (auto &p : *exif_) {
|
||||
try {
|
||||
out[p.first] = p.second;
|
||||
} catch (Exiv2::AnyError &exc) {}
|
||||
} catch (std::exception &exc) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ void Exiv2Metadata::import_iptc_pairs(Exiv2::IptcData &out) const
|
||||
out.add(d);
|
||||
}
|
||||
}
|
||||
} catch (Exiv2::AnyError &exc) {}
|
||||
} catch (std::exception &exc) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user