Commit 117e9b18 authored by Romain Courteaud's avatar Romain Courteaud

[indexeddb] return a jIOError in case of connection error

parent 58c970e5
...@@ -147,8 +147,11 @@ ...@@ -147,8 +147,11 @@
(error.target instanceof IDBOpenDBRequest) && (error.target instanceof IDBOpenDBRequest) &&
((error.target.error instanceof DOMError) || ((error.target.error instanceof DOMError) ||
(error.target.error instanceof DOMException))) { (error.target.error instanceof DOMException))) {
reject("Connection to: " + db_name + " failed: " + reject(new jIO.util.jIOError(
error.target.error.message); "Connection to: " + db_name + " failed: " +
error.target.error.message,
500
));
} else { } else {
reject(error); reject(error);
} }
......
...@@ -196,11 +196,13 @@ ...@@ -196,11 +196,13 @@
test("version decrease", function () { test("version decrease", function () {
var context = this; var context = this;
expect(1); expect(3);
return setupDBMigrationTest(context, {version: 3}, return setupDBMigrationTest(context, {version: 3},
{version: 2}, function (msg) { {version: 2}, function (error) {
ok(startsWith(msg, "Connection to: jio:qunit failed: ")); ok(error instanceof jIO.util.jIOError);
equal(error.status_code, 500);
ok(startsWith(error.message, "Connection to: jio:qunit failed: "));
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment