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

242
Views
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
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!