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

437
Views
Cómo manejar/interceptar net::ERR_HTTP2_PROTOCOL_ERROR 200

Estimados desarrolladores experimentados, realmente agradecería su ayuda con lo siguiente.

Cuando ejecuto el siguiente código [Chrome Version 100.0.4896.127 (Official Build) (arm64), macOS Monterey Version 12.3] de vez en cuando (intermitentemente) aparece el siguiente error:

red::ERR_HTTP2_PROTOCOL_ERROR 200

y la ejecución se detiene.

 <!DOCTYPE html> <html> <head> <style> </style> </head> <body> <script> function sleep(milliseconds) { const date = Date.now(); let currentDate = null; do { currentDate = Date.now(); } while (currentDate - date < milliseconds); } async function doIt() { while(true) { for (let i = 1; i < 7; i++) { let response = await fetch("court"+i+".txt", {cache: "no-store"}); let contents = await response.text(); let components = contents.split(";"); let CourtActive = components[0]; let CourtName = components[1]; let CourtLastUpdate = components [2]; console.log(CourtActive); console.log(CourtName); console.log(CourtLastUpdate); } sleep(1000); } } doIt(); </script> </body> </html>

El contenido de courtX.txt se carga en el servidor a través de ftp y se ve así:

1;TribunalX;0

Sospecho que el error ocurre cuando la búsqueda se ejecuta justo cuando el archivo se está actualizando y, por alguna razón, Chrome no lo maneja correctamente (el error no ocurre cuando uso Safari). Entonces, mi pregunta es cómo puedo interceptar el error (intentar, atrapar no lo hace) de tal manera que solo vaya a la declaración de búsqueda si estoy seguro de que el archivo es estable.

Espero haberme dejado lo suficientemente claro y muchas gracias de antemano por cualquier pista.

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!