Skip to content

Commit

Permalink
Failed request commented
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Jun 27, 2023
1 parent 59d585b commit 0ae753e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/commands/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,22 @@ export default abstract class Command {
event.page = page;

// page.on("pageerror", (e) => this.pageError = e );
page.on("requestfailed", (e) => {
if (e.response()?.status() <= 409) {
return;
}
try {
this.failed = `Request failed for ${e.url()}\r\n${e.failure().errorText}`;
const response = e.response();
if (response) {
response.text().then((r) => {
this.failed += `\r\n${r}`;
});
}
} catch (error) {
console.error(error);
}
})
// page.on("requestfailed", (e) => {
// if (e.response()?.status() <= 409) {
// return;
// }
// try {
// this.failed = `Request failed for ${e.url()}\r\n${e.failure().errorText}`;
// const response = e.response();
// if (response) {
// response.text().then((r) => {
// this.failed += `\r\n${r}`;
// });
// }
// } catch (error) {
// console.error(error);
// }
// })

// if it is html...
// disable image/css/font/video...
Expand Down

0 comments on commit 0ae753e

Please sign in to comment.