Skip to content

Commit 7c246fe

Browse files
committed
Catch the finished promise AbortError and rethrow any error that isn't an AbortError
1 parent 08e5776 commit 7c246fe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/transition.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,13 @@ function nextFrame() {
7979
}
8080

8181
function afterTransition(element) {
82-
return Promise.all(element.getAnimations().map(animation => animation.finished))
82+
return Promise.all(
83+
element.getAnimations().map(animation => {
84+
return animation.finished.catch(e => {
85+
if (e.name !== 'AbortError') {
86+
throw e
87+
}
88+
})
89+
}),
90+
)
8391
}

0 commit comments

Comments
 (0)