sacred-emeraldS
Apify & Crawleeโ€ข4y agoโ€ข
7 replies
sacred-emerald

failedRequestHandler, error argument, detailed error message lost

I am using PlaywrightCrawler and the failedRequestHandler to handle errors.
Something like this:
const crawler = new PlaywrightCrawler({
    ...
    async failedRequestHandler({request, response, page, log}, error) {

    ...

And sometimes I see errors in the log:
ERROR failedRequestHandler: Request failed and reached maximum retries. page.goto: SSL_ERROR_BAD_CERT_DOMAIN


But! when I am looking inside the
error
argument of the failedRequestHandler with the
JSON.stringify(error)

I see only this:
{"name":"Error"}


It seems, the detailed error message I see in the log is not accessible in the
error
argument.

So, how to access the detailed error message in code?
Was this page helpful?