Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
117e9b18
Commit
117e9b18
authored
Sep 16, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[indexeddb] return a jIOError in case of connection error
parent
58c970e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+5
-2
test/jio.storage/indexeddbstorage.tests.js
test/jio.storage/indexeddbstorage.tests.js
+5
-3
No files found.
src/jio.storage/indexeddbstorage.js
View file @
117e9b18
...
...
@@ -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
);
}
...
...
test/jio.storage/indexeddbstorage.tests.js
View file @
117e9b18
...
...
@@ -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:
"
));
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment