Throw a mysql exception

It a mysql error or exception, just throw as it is.
This commit is contained in:
Huang Youchuan
2017-12-11 09:23:10 +08:00
committed by GitHub
parent 79e222e3c2
commit 0cbc9f33c5
+5 -1
View File
@@ -368,7 +368,11 @@ void hard_exec(MYSQL *conn, const string & query)
if (0 != mysql_real_query(conn, query.c_str(),
static_cast<unsigned long>(query.size())))
{
throw soci_error(mysql_error(conn));
//throw soci_error(mysql_error(conn));
string errMsg = mysql_error(conn);
unsigned int errNum = mysql_errno(conn);
throw mysql_soci_error(errMsg, errNum);
}
}