Skip to content

Commit 4405c21

Browse files
feat: better onPageArchived call
1 parent 115669f commit 4405c21

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/recorder.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,11 +1140,15 @@ class Recorder {
11401140
}
11411141

11421142
if (finished && currPage.url) {
1143-
onPageArchived(currPage.url, currPage.size)
1144-
.then(() => {})
1145-
.catch((err) => {
1143+
try {
1144+
// Fire and forget, but with immediate error handling
1145+
onPageArchived(currPage.url, currPage.size).catch((err) => {
11461146
console.error("onPageArchived failed:", err);
11471147
});
1148+
} catch (err) {
1149+
// Handle synchronous errors too
1150+
console.error("onPageArchived synchronous error:", err);
1151+
}
11481152
}
11491153

11501154
return res;

0 commit comments

Comments
 (0)