From 24184b6dc19ac00db2ad19ce51b137c093c2e55e Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 5 Apr 2013 01:19:41 -0400 Subject: [PATCH] Throw errors instead of strings for DB errors --- chrome/content/zotero/xpcom/db.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index 07f0cf18c1..dfd5e27e3b 100644 --- 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;