Raise an exception when an error takes place

(https://github.com/oracle/python-cx_Oracle/issues/299).
This commit is contained in:
Anthony Tuininga 2019-04-29 11:40:48 -06:00
parent 1c474bbaab
commit ce511e2fb7

View File

@ -246,7 +246,9 @@ int cxoTransform_fromPython(cxoTransformNum transformNum, PyObject *pyValue,
status = dpiLob_setFromBytes(dbValue->asLOB, buffer->ptr, status = dpiLob_setFromBytes(dbValue->asLOB, buffer->ptr,
buffer->size); buffer->size);
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
return status; if (status < 0)
return cxoError_raiseAndReturnInt();
return 0;
case CXO_TRANSFORM_NATIVE_INT: case CXO_TRANSFORM_NATIVE_INT:
#if PY_MAJOR_VERSION < 3 #if PY_MAJOR_VERSION < 3
if (PyInt_Check(pyValue)) { if (PyInt_Check(pyValue)) {