Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
dd7bb28d
Commit
dd7bb28d
authored
Jun 05, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report traceback when `waitUntil` times out
parent
58d018e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/headless/utils/core.js
src/headless/utils/core.js
+8
-3
No files found.
src/headless/utils/core.js
View file @
dd7bb28d
...
...
@@ -575,6 +575,7 @@ u.waitUntil = function (func, max_wait=300, check_delay=3) {
}
const
promise
=
u
.
getResolveablePromise
();
const
timeout_err
=
new
Error
();
function
checker
()
{
try
{
...
...
@@ -590,12 +591,16 @@ u.waitUntil = function (func, max_wait=300, check_delay=3) {
}
const
interval
=
setInterval
(
checker
,
check_delay
);
const
max_wait_timeout
=
setTimeout
(()
=>
{
function
handler
()
{
clearTimers
(
max_wait_timeout
,
interval
);
const
err_msg
=
'
Wait until promise timed out
'
;
const
err_msg
=
`Wait until promise timed out: \n\n
${
timeout_err
.
stack
}
`
;
console
.
trace
();
log
.
error
(
err_msg
);
promise
.
reject
(
new
Error
(
err_msg
));
},
max_wait
);
}
const
max_wait_timeout
=
setTimeout
(
handler
,
max_wait
);
return
promise
;
};
...
...
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