Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pptr/mod.ts>HTTPRequest#failure

Headless Chrome Deno API
Latest
method HTTPRequest.prototype.failure
Re-export
import { HTTPRequest } from "https://deno.land/x/pptr@1.2.0/mod.ts";

Access information about the request's failure.

Examples

Example of logging all failed requests:

page.on('requestfailed', request => {
  console.log(request.url() + ' ' + request.failure().errorText);
});

Returns

{ errorText: string; } | null

null unless the request failed. If the request fails this can return an object with errorText containing a human-readable error message, e.g. net::ERR_FAILED. It is not guaranteeded that there will be failure text if the request fails.