From bfa25cae37a69a469240060d79b017f55f6625b7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 16 Jun 2006 22:15:07 +0000 Subject: [PATCH] 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) --- chrome/chromeFiles/content/scholar/xpcom/db.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/xpcom/db.js b/chrome/chromeFiles/content/scholar/xpcom/db.js index 0330a73bea..7e0e6d0aa4 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/db.js +++ b/chrome/chromeFiles/content/scholar/xpcom/db.js @@ -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 + ']'); + } } }