Close browser even if screenshot fails; handle case where webp screenshot fails

This commit is contained in:
Saoud Rizwan
2024-09-21 16:24:59 -04:00
parent 2e272a1ad3
commit 46ceafa016
2 changed files with 39 additions and 7 deletions

View File

@@ -1471,8 +1471,16 @@ export class ClaudeDev {
await this.say("inspect_site_result", "") // no result, starts the loading spinner waiting for result
await this.urlContentFetcher.launchBrowser()
const { screenshot, logs } = await this.urlContentFetcher.urlToScreenshotAndLogs(url)
await this.urlContentFetcher.closeBrowser()
let result: {
screenshot: string
logs: string
}
try {
result = await this.urlContentFetcher.urlToScreenshotAndLogs(url)
} finally {
await this.urlContentFetcher.closeBrowser()
}
const { screenshot, logs } = result
await this.say("inspect_site_result", logs, [screenshot])
return [