Display SQLite error in exceptions thrown from commitTransaction() and rollbackTransaction() (like the ones on field value updates that I'm trying to figure out at the moment)

This commit is contained in:
Dan Stillman 2006-06-16 22:15:07 +00:00
commit bfa25cae37

View file

@ -215,7 +215,12 @@ Scholar.DB = new function(){
}
else {
Scholar.debug('Committing transaction',5);
db.commitTransaction();
try {
db.commitTransaction();
}
catch(e){
throw(e + ' [ERROR: ' + db.lastErrorString + ']');
}
}
}
@ -230,7 +235,12 @@ Scholar.DB = new function(){
else {
Scholar.debug('Rolling back transaction', 5);
_transactionRollback = false;
db.rollbackTransaction();
try {
db.rollbackTransaction();
}
catch(e){
throw(e + ' [ERROR: ' + db.lastErrorString + ']');
}
}
}