]> granicus.if.org Git - pdns/commitdiff
Improve error logging in goracle
authorAki Tuomi <cmouse@cmouse.fi>
Sat, 12 Sep 2015 21:44:33 +0000 (00:44 +0300)
committerAki Tuomi <cmouse@cmouse.fi>
Sat, 12 Sep 2015 21:44:33 +0000 (00:44 +0300)
modules/goraclebackend/soracle.cc

index 19e7aae934cc4e2b08a8e6234ae437f2623b0b5b..c5142acea8d55c9dec3b11a0b2a9d1aea2bbcc4d 100644 (file)
@@ -427,20 +427,20 @@ SOracle::SOracle(const string &database,
 
   int err = OCIHandleAlloc(d_environmentHandle, (dvoid**) &d_errorHandle, OCI_HTYPE_ERROR, 0, NULL);
   if (err) {
-    throw sPerrorException("OCIHandleAlloc(errorHandle)");
+    throw sPerrorException("OCIHandleAlloc(errorHandle)" + string(": ") + getOracleError());
   }
 
   err = OCILogon2(d_environmentHandle, d_errorHandle, &d_serviceContextHandle, (OraText*)user.c_str(), user.size(), 
                  (OraText*) password.c_str(),  strlen(password.c_str()), (OraText*) database.c_str(), strlen(database.c_str()), OCI_LOGON2_STMTCACHE);
   // increase statement cache to 100
   if (err) {
-    throw sPerrorException("OCILogon2");
+    throw sPerrorException(string("OCILogon2") + string(": ") + getOracleError());
   }
 
   ub4 cacheSize = 100;
   err = OCIAttrSet(d_serviceContextHandle, OCI_HTYPE_SVCCTX, &cacheSize, sizeof(ub4), OCI_ATTR_STMTCACHESIZE, d_errorHandle);
   if (err) {
-    throw sPerrorException("OCIAttrSet(stmtcachesize)");
+    throw sPerrorException("OCIAttrSet(stmtcachesize): " + string(": ") + getOracleError());
   }
 
 }