Commit 0a73cf79 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Make insert_record throw an exception instead of triggering an error. I

suspect more functions in dml.php will need to be changed, but that was the
obvious one.
parent 68dae3ea
......@@ -860,7 +860,7 @@ function insert_record($table, $dataobject, $primarykey=false, $returnpk=false)
&& ($rs->RecordCount() == 1) ) {
return (integer)$rs->fields[0];
}
trigger_error('Failed to retrieve primary key after insert: SELECT '. $primarykey .
throw new SQLException('Failed to retrieve primary key after insert: SELECT '. $primarykey .
' FROM '. $CFG->dbprefix . $table .' WHERE oid = '. $id);
return false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment