Commit d538e7f9 authored by Romain Courteaud's avatar Romain Courteaud

erp5_core: fix cancellation handling

parent d5925cc9
...@@ -101,20 +101,10 @@ ...@@ -101,20 +101,10 @@
try { try {
result = callback(evt); result = callback(evt);
} catch (e) { } catch (e) {
result = RSVP.reject(e); return reject(e);
} }
callback_promise = result; callback_promise = new RSVP.Queue(result).push(undefined, reject);
new RSVP.Queue()
.push(function () {
return result;
})
.push(undefined, function (error) {
if (!(error instanceof RSVP.CancellationError)) {
canceller();
reject(error);
}
});
}; };
target.addEventListener(type, handle_event_callback, useCapture); target.addEventListener(type, handle_event_callback, useCapture);
......
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