title: how to show error message in react js when http request send?
body: <p>could you please tell me how to show error message in react js when http request send ?</p>
  
  <p>I make a service in the nodejs where I am sending <code>400</code> status with <code>error message</code> . I want to show this error message on <code>frontend</code>.</p>
  
  <pre><code>app.get('/a',(req,res)=&gt;{
      res.status(400).send({message:" some reason error message"})
  })
  </code></pre>
  
  <p>Now I want to show this error message on frontend .<code>on catch I will not get this message</code>.</p>
  
  <pre><code>try {
              const r = await axios.get('http://localhost:3002/a');
  } catch (e) {
              console.log('===============================================')
              console.log(e)
              console.log(e.data)
              hideLoading();
              setErrorMessage(e.message);
              showErrorPopUp();
          }
  </code></pre>
  
  <p><code>on catch</code> i will not get this message.getting on <code>stack of error
  [![enter image description here][1]][1]</code></p>
  
  <p><a href="https://i.stack.imgur.com/s81hy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/s81hy.png" alt="enter image description here"></a></p>