title: Then code of an axios.get not completed and error catched
body: <p>I'm trying to understand the flow of following code using <code>console.log</code> traces:</p>
  
  <pre><code>function fetchTsValues() {
  
      console.log("fetchTsValues");
  
      axios.get(urlValues)
          .then(result =&gt; valuesToChannel(result.data))
          .catch(() =&gt; setError('Impossible to get TS values'));
  }
  
  useEffect(() =&gt; {
      fetchTsValues();
  }, []);
  
  function valuesToChannel(TSDetailAPI) {
  
      console.log(TSDetailAPI);
      console.log("valuesToChannel");
  
      const updatedChannels = {...channels};
      console.log("updatedChannels - 1", updatedChannels);
      updatedChannels[TSDetailAPI.name].series = buildSeries(TSDetailAPI.values);
  
      console.log("updatedChannels - 2", updatedChannels);
      setChannels(updatedChannels);
      setIsLoading(false);
  }
  
  console.log("error", error);
  </code></pre>
  
  <p>The traces are following ones:</p>
  
  <pre><code>fetchTsValues
  valuesToChannel
  updatedChannels - 1 {demo-temperature-1: {…}}
  error Impossible to get TS values
  </code></pre>
  
  <p>What I don't understand is why I start to run <code>valuesToChannel</code> initial instructions before being stopped by the catch of <code>fetchTsValues</code> <code>axios.get</code>. The <code>get</code> runs correctly with a 200 return status code.</p>
  
  <p>I could understand to finish the <code>then</code> and then if the promise is not delivered to move to the <code>catch</code>. But here the code is not even ending the <code>then</code> clause. <strong>What am I doing wrong or not understanding?</strong></p>
  
  <p><em>Note: this code is part of a wider react context. But I think that I have properly figured out a reduced context.</em></p>