Bug 1111284 - Improve error messages of Sqlite.jsm by including specific error message. r=Yoric

This commit is contained in:
Jacob Clark 2014-12-14 21:26:31 +00:00
parent d08b318c3c
commit ec58d2a226
2 changed files with 4 additions and 5 deletions

View File

@ -682,7 +682,7 @@ ConnectionData.prototype = Object.freeze({
break;
case Ci.mozIStorageStatementCallback.REASON_ERROR:
let error = new Error("Error(s) encountered during statement execution.");
let error = new Error("Error(s) encountered during statement execution: " + [error.message for (error of errors)].join(", "));
error.errors = errors;
deferred.reject(error);
break;

View File

@ -933,10 +933,9 @@ add_task(function* test_readOnly_clone() {
// Just check that it works.
yield clone.execute("SELECT 1");
// But should not be able to write.
try {
yield clone.execute("CREATE TABLE test (id INTEGER PRIMARY KEY)");
do_throw(new Error("Should not be able to write to a read-only clone."));
} catch (ex) {}
yield Assert.rejects(clone.execute("CREATE TABLE test (id INTEGER PRIMARY KEY)"),
/readonly/);
// Closing order should not matter.
yield c.close();
yield clone.close();