diff --git a/html/inc/db_conn.inc b/html/inc/db_conn.inc
index ab00049693..f00f54a053 100644
--- a/html/inc/db_conn.inc
+++ b/html/inc/db_conn.inc
@@ -37,10 +37,13 @@ class DbConn {
}
function do_query($q) {
+ global $generating_xml;
//echo "query: $q
\n";
$ret = mysql_query($q, $this->db_conn);
if (!$ret) {
- echo "Database Error
\n";
+ if (!$generating_xml) {
+ echo "Database Error
\n";
+ }
//echo ": ", mysql_error(), "\n
"; //var_dump(debug_backtrace()); //echo "query: $q\n"; diff --git a/html/user/submit_rpc_handler.php b/html/user/submit_rpc_handler.php index 32b7a338e6..2f163958a3 100644 --- a/html/user/submit_rpc_handler.php +++ b/html/user/submit_rpc_handler.php @@ -215,7 +215,9 @@ function submit_batch($r) { $batch_id = BoincBatch::insert( "(user_id, create_time, njobs, name, app_id, logical_end_time, state) values ($user->id, $now, $njobs, '$batch_name', $app->id, $let, ".BATCH_STATE_IN_PROGRESS.")" ); - if (!$batch_id) xml_error(-1, "BoincBatch::insert() failed"); + if (!$batch_id) { + xml_error(-1, "Can't create batch: ".mysql_error()); + } } $i = 0; foreach($jobs as $job) { @@ -232,6 +234,9 @@ function create_batch($r) { $batch_id = BoincBatch::insert( "(user_id, create_time, name, app_id, state) values ($user->id, $now, '$batch_name', $app->id, ".BATCH_STATE_INIT.")" ); + if (!$batch_id) { + xml_error(-1, "Can't create batch: ".mysql_error()); + } echo "