title: how to fix UnhandledPromiseRejectionWarning
body: <p>I am trying to fix my error but i don't know how. i have researched around looking for node <code>UnhandledPromiseRejectionWarning</code> but i haven't been able to fix it.</p>
  
  <pre><code>function getBandsInTown(artist) {
  
      var artist = userInput;
      var bandQueryURL = "https://rest.bandsintown.com/artists/" + artist + "/events?app_id=codingbootcamp"
  
      axios.get(bandQueryURL).then(
          function (response) {
              console.log("=============================");
              console.log("Name of the venue: " + response.data[0].venue.name + "\r\n");
              console.log("Venue Location: " + response.data[0].venue.city + "\r\n");
              console.log("Date of event: " + moment(response.data[0].datetime).format("MM-DD-YYYY") + "\r\n");
  
              var logConcert = "======Begin Concert Log Entry======" + "\nName of the musician: " + artist + "\nName of the venue: " + response.data[0].venue.name + "\nVenue location: " + response.data[0].venue.city + "\n Date of event: " + moment(response.data[0].datetime).format("MM-DD-YYYY") + "\n======End Concert Log Entry======" + "\n";
  
              fs.appendFile("log.txt", logConcert, function (err) {
                  if (err) throw err;
              })
  
              // logResults(response.data)
          });
  </code></pre>
  
  <blockquote>
    <p>(node:18908) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'venue' of undefined
        at C:\Users\Aaron Lanier\gt\sandbox\liri-node-app\liri.js:104:66
        at process._tickCallback (internal/process/next_tick.js:68:7)
    (node:18908) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)</p>
    
    <p>(node:18908) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.</p>
  </blockquote>