Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

386
Views
¿Hay alguna manera de reemplazar con un error personalizado cada mensaje de error asíncrono sin intentar capturar cada función?

digamos el método de lanzamiento si no se encuentra el ejecutable, arrojará el error con el tipo de cadena. por qué no objeta { message: 'Error failed', additionalInfo: 'trouble', executablePath: 'c:/' } . sucede al método casi titiritero. así que necesito reemplazarlo.

Error: ¡Error al iniciar el proceso del navegador! spawn H:/WebGame/GoogleChrome/chromess.exe RESOLUCIÓN DE PROBLEMAS DE ENOENT: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

en cambio, debajo de las formas.

 class CustomError extends Error { constructor(executablePath) { super() this.message = 'Error: Failed to launch the browser process!'; this.executablePath = executablePath; } } class Application { constructor() { this.browser; } async launch(options) { try { this.browser = await puppeteer.launch(); return this.browser } catch(e) { throw new CustomError(options.executablePath) } } async close() await this.browser.close() }

simplemente hay que reemplazar el error?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!