Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
Catch ERR_CONNECTION_REFUSED Error in React

I am trying to Catch an Error of my Fetch Function.

enter image description here

ive tried to catch my function with this:

updateState() {
    fetch('http://127.0.0.1:3333/xxx')
        .then((res) => res.json())
        .then((json) => {
                this.setState(() => {
                    return {
                        lightState: json.value
                    }
                });
            }
        ).catch(function () {
        console.log("error");
    });
}

but i still get the Errormessage in the console

PS: In the Console i also get the "error" from the catch function. But the ERR_CONNECTION_REFUSED error still comes up

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda