Author: mysqlpp
Date: Mon Dec  3 11:53:56 2007
New Revision: 1961

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1961&view=rev
Log:
Clearer error check in simple3

Modified:
    trunk/examples/simple3.cpp

Modified: trunk/examples/simple3.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/simple3.cpp?rev=1961&r1=1960&r2=1961&view=diff
==============================================================================
--- trunk/examples/simple3.cpp (original)
+++ trunk/examples/simple3.cpp Mon Dec  3 11:53:56 2007
@@ -71,9 +71,14 @@
                                                endl;
                        }
 
-                       // Check for error: can't distinguish error return or 
normal
-                       // "end of results" return from fetch_row() otherwise.
-                       return con.errnum();
+                       // Check for error: can't distinguish "end of results" 
and
+                       // error cases in return from fetch_row() otherwise.
+                       if (conn.errnum()) {
+                               cerr << "Error received in fetching a row: " <<
+                                               conn.error() << endl;
+                               return 1;
+                       }
+                       return 0;
                }
                else {
                        cerr << "Failed to get stock item: " << query.error() 
<< endl;


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

Reply via email to