Error when using axios

When I use method getPost below i get this error message
createError.js?2d83:16 Uncaught (in promise) Error: Network Error
at createError (createError.js?2d83:16)
at XMLHttpRequest.handleError (xhr.js?b50d:83)

Does anyone know why I get this.

static getPosts() {

   return new Promise((resolve, reject) => {
      try {
         const res =  axios.get(url);
         const data = res.data;

         resolve(
            data.map(post => ({
              ...post,
              createdAt: new Date(post.createdAt)
            }))
         );
      } 
      catch(err)
      {
         console.log(err.message),
         reject(err);
      }
   });
}

//tony

Network Error means you are offline or just the url you specified is wrong perhaps.
Since we don’t know about your backend. Please check again that you are pointing to the correct and valid url.