-
-
Notifications
You must be signed in to change notification settings - Fork 782
Open
Labels
Description
Describe the bug
Currently, when using the puppeteer-extra-plugin-recaptcha package with throwOnError set to true and a PuppeteerExtraPluginRecaptcha error is thrown here, the argument passed to Error is an object. So the information on the error gets lost, leaving no way for consumer code to know about what caused the error.
It just outputs the following as a console warning:
PuppeteerExtraPluginRecaptcha: An error occured during "getRecaptchaSolutions": {
_vendor: 'recaptcha',
provider: '2captcha',
id: '[redacted]',
requestAt: 2021-05-09T01:35:25.450Z,
error: 'Error: 2captcha error: [redacted]'
}...and the thrown error is an empty object, so it can't be evaluated:
try {
let { captchas } = await page.findRecaptchas();
if (!captchas.length) {
return;
}
await page.solveRecaptchas();
} catch (e) {
console.log(e) // <== cannot evaluate this error because it has no information
}Reactions are currently unavailable