aboutsummaryrefslogtreecommitdiffstats
path: root/src/exiv2wrapper.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-03-16 17:32:57 +0100
committerOlivier Tilloy <olivier@tilloy.net>2010-03-16 17:32:57 +0100
commit6aa0522ffd10020117eef208330c22de14969290 (patch)
treed6bc16573d7555cb85686c35dc3d87d801133ae1 /src/exiv2wrapper.cpp
parent0ed83f2136ac4ca36200afd2ff45b2ddf2eb84d8 (diff)
downloadpyexiv2-6aa0522ffd10020117eef208330c22de14969290.tar.gz
Copy the error instead of instantiating a new one from its code.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r--src/exiv2wrapper.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index 8c63701..828b13b 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -44,7 +44,7 @@ namespace exiv2wrapper
void Image::_instantiate_image()
{
bool success = true;
- int error_code;
+ Exiv2::Error error(0);
// Release the GIL to allow other python threads to run
// while opening the file.
@@ -54,10 +54,10 @@ void Image::_instantiate_image()
{
_image = Exiv2::ImageFactory::open(_filename);
}
- catch (Exiv2::Error& error)
+ catch (Exiv2::Error& err)
{
success = false;
- error_code = error.code();
+ error = err;
}
// Re-acquire the GIL
@@ -70,7 +70,7 @@ void Image::_instantiate_image()
}
else
{
- throw Exiv2::Error(error_code, _filename);
+ throw error;
}
}