Throw errors instead of strings for DB errors
This commit is contained in:
parent
49da992285
commit
24184b6dc1
1 changed files with 2 additions and 2 deletions
|
@ -177,7 +177,7 @@ Zotero.DBConnection.prototype.query = function (sql,params) {
|
||||||
|
|
||||||
var dberr = (db.lastErrorString!='not an error')
|
var dberr = (db.lastErrorString!='not an error')
|
||||||
? ' [ERROR: ' + db.lastErrorString + ']' : '';
|
? ' [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) {
|
catch (e) {
|
||||||
var dberr = (db.lastErrorString!='not an error')
|
var dberr = (db.lastErrorString!='not an error')
|
||||||
? ' [ERROR: ' + db.lastErrorString + ']' : '';
|
? ' [ERROR: ' + db.lastErrorString + ']' : '';
|
||||||
throw(e + ' [QUERY: ' + sql + ']' + dberr);
|
throw new Error(e + ' [QUERY: ' + sql + ']' + dberr);
|
||||||
}
|
}
|
||||||
|
|
||||||
var numParams = statement.parameterCount;
|
var numParams = statement.parameterCount;
|
||||||
|
|
Loading…
Reference in a new issue