title: How to fix error "Cannot read property 'statusText' of undefined"
body: <p>So I am getting this error when trying to delete an education/experience field, in the webapp. But when I press to delete, it throws me an error:</p>
  <pre><code>Unhandled Rejection (TypeError): Cannot read property 'statusText' of undefined
  </code></pre>
  <p>And it happens when It tries to send a payload. Here is the code, that causes the error:</p>
  <pre><code>  161 | } catch (err) {
    162 |   dispatch({
    163 |     type: PROFILE_ERROR,
  &gt; 164 |     payload: { msg: err.response.statusText, status: err.response.status },
    165 | ^    });
    166 |   console.log(err.response);
    167 | }
  </code></pre>
  <p>Here is the actions file for the delete:</p>
  <pre><code>export const deleteEducation = (id) =&gt; async (dispatch) =&gt; {
    try {
      const res = axios.await(`/api/profile/education/${id}`);
  
      dispatch({
        type: UPDATE_PROFILE,
        payload: res.data,
      });
  
      dispatch(setAlert('Education Deleted', 'success'));
    } catch (err) {
      dispatch({
        type: PROFILE_ERROR,
        payload: { msg: err.response.statusText, status: err.response.status },
      });
      console.log(err.response);
    }
  };
  </code></pre>
  <p>Here is the API code for the delete funtion:</p>
  <pre><code>// @route   DELETE api/profile/:edu_id
  // @desc    Delete education from profile
  //@access  Private
  router.delete('/education/:edu_id', auth, async (req, res) =&gt; {
    try {
      const profile = await Profile.findOne({ user: req.user.id });
      const removeIndex = profile.education
        .map((item) =&gt; item.id)
        .indexOf(req.params.edu_id);
      profile.education.splice(removeIndex, 1);
  
      await profile.save();
      res.json({ msg: 'Education Deleted' });
    } catch (err) {
      console.log(err.message);
      res.status(500).send('Server Error');
    }
  });
  </code></pre>
  <p>I'm having really hard time understanding redux, so I don't know how to fix it.</p>