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 @@
(error.target instanceof IDBOpenDBRequest) &&
((error.target.error instanceof DOMError) ||
(error.target.error instanceof DOMException))) {
reject("Connection to: " + db_name + " failed: " +
error.target.error.message);
reject(new jIO.util.jIOError(
"Connection to: " + db_name + " failed: " +
error.target.error.message,
500
));
} else {
reject(error);
}
......
......@@ -196,11 +196,13 @@
test("version decrease", function () {
var context = this;
expect(1);
expect(3);
return setupDBMigrationTest(context, {version: 3},
{version: 2}, function (msg) {
ok(startsWith(msg, "Connection to: jio:qunit failed: "));
{version: 2}, function (error) {
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