Skip to content

Commit 4e7001a

Browse files
fix: clean up pending promises on action errors (#84)
1 parent d622b9b commit 4e7001a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/WaitForHelper.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@ export class WaitForHelper {
138138
})
139139
.catch(error => logger(error));
140140

141-
await action();
141+
try {
142+
await action();
143+
} catch (error) {
144+
// Clear up pending promises
145+
this.#abortController.abort();
146+
throw error;
147+
}
142148

143149
try {
144150
await navigationFinished;

0 commit comments

Comments
 (0)