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
+2 -2
View File
@@ -18,12 +18,12 @@ try {
// Read data file into data buffer
Exiv2::FileIo io(data);
if (io.open() != 0) {
throw Exiv2::Error(9, io.path(), Exiv2::strError());
throw Exiv2::Error(Exiv2::kerDataSourceOpenFailed, io.path(), Exiv2::strError());
}
Exiv2::DataBuf buf((long)io.size());
std::cout << "Reading " << buf.size_ << " bytes from " << data << "\n";
io.read(buf.pData_, buf.size_);
if (io.error() || !io.eof()) throw Exiv2::Error(14);
if (io.error() || !io.eof()) throw Exiv2::Error(Exiv2::kerFailedToReadImageData);
// Read metadata from file
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(file);