Author: wyoung
Date: Sat Dec  8 00:06:52 2007
New Revision: 1983

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1983&view=rev
Log:
Result::field_num() returns -1 instead of throwing BadFieldName if
exceptions are disabled.  Now all sources of this exception are
optional.

Modified:
    trunk/lib/result.cpp

Modified: trunk/lib/result.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/result.cpp?rev=1983&r1=1982&r2=1983&view=diff
==============================================================================
--- trunk/lib/result.cpp (original)
+++ trunk/lib/result.cpp Sat Dec  8 00:06:52 2007
@@ -124,7 +124,12 @@
 {
        size_t index = (*names_)[i];
        if ((index >= names_->size()) && throw_exceptions()) {
-               throw BadFieldName(i.c_str());
+               if (throw_exceptions()) {
+            throw BadFieldName(i.c_str());
+        }
+        else {
+            return -1;
+        }
        }
        
        return int(index);


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to