fix exception for older opencv versions

This commit is contained in:
Peter Braden 2012-05-31 15:57:39 -04:00
parent 0c7d496c0d
commit d154496199

View File

@ -71,8 +71,12 @@ OpenCV::ReadImage(const Arguments &args) {
return Undefined(); return Undefined();
} catch( cv::Exception& e ){ } catch( cv::Exception& e ){
#if CV_MINOR_VERSION > 0
const char* err_msg = e.what(); const char* err_msg = e.what();
return v8::ThrowException(v8::Exception::Error(v8::String::New(err_msg))); return v8::ThrowException(v8::Exception::Error(v8::String::New(err_msg)));
#else
return v8::ThrowException(v8::Exception::Error(v8::String::New("OpenCV Error")));
#endif
} }
}; };