Skip to content

Commit 3ffa6de

Browse files
MatthewZMSUMatthew
andauthored
Throw error on 2captcha bad responses (#71)
Co-authored-by: Matthew <[email protected]>
1 parent d2782fe commit 3ffa6de

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ async function setupBrowser() {
5353
if (TOKEN_2CAPTCHA) { // If token is given then RecaptchaPlugin is activated
5454
puppeteer.use(
5555
RecaptchaPlugin({
56+
// We will see Error: [object Object] in logs because PuppeteerExtraPluginRecaptcha is build badly with `Error(response.error)`
57+
// https://stackoverflow.com/questions/58252067/pass-an-object-with-js-throw-new-error-in-node
58+
throwOnError: true,
5659
provider: {
5760
id: '2captcha',
5861
token: TOKEN_2CAPTCHA

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scrapy-puppeteer-service",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"private": true,
55
"scripts": {
66
"start": "node ./bin/www"

0 commit comments

Comments
 (0)