commit 24184b6dc19ac00db2ad19ce51b137c093c2e55e
parent 49da992285fe302d3c6e8bbfd8192f1832a16831
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 5 Apr 2013 01:19:41 -0400
Throw errors instead of strings for DB errors
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js
@@ -177,7 +177,7 @@ Zotero.DBConnection.prototype.query = function (sql,params) {
var dberr = (db.lastErrorString!='not an error')
? ' [ERROR: ' + db.lastErrorString + ']' : '';
- throw(e + ' [QUERY: ' + sql + ']' + dberr);
+ throw new Error(e + ' [QUERY: ' + sql + ']' + dberr);
}
}
@@ -256,7 +256,7 @@ Zotero.DBConnection.prototype.getStatement = function (sql, params, checkParams)
catch (e) {
var dberr = (db.lastErrorString!='not an error')
? ' [ERROR: ' + db.lastErrorString + ']' : '';
- throw(e + ' [QUERY: ' + sql + ']' + dberr);
+ throw new Error(e + ' [QUERY: ' + sql + ']' + dberr);
}
var numParams = statement.parameterCount;