We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 523b2ef commit e5e94beCopy full SHA for e5e94be
packages/puppeteer-extra-plugin-recaptcha/src/index.ts
@@ -235,7 +235,16 @@ export class PuppeteerExtraPluginRecaptcha extends PuppeteerExtraPlugin {
235
)
236
}
237
if (this.opts.throwOnError && response.error) {
238
- throw new Error(response.error)
+ const { error } = response
239
+ const { error: message } = error
240
+ // build custom error so consumers can evaluate its properties
241
+ const customError = new Error(message)
242
+ for (const key in error) {
243
+ if (Object.prototype.hasOwnProperty.call(error, key)) {
244
+ customError[key] = error[key]
245
+ }
246
247
+ throw customError
248
249
return response
250
0 commit comments