title: check connection to xml file for 404 Google Apps-Script
body: <p>I created a Google Doc add-on that connects to an xml file to read some data. No issues, but with Chromebooks, Google docs can be used offline, so obviously the connection fails. I want to catch any error on the  UrlFetchApp.fetch() method, but I don't see anything <a href="https://developers.google.com/apps-script/reference/xml-service/" rel="nofollow">on the API site</a> . Here is my connection code:</p>
  
  <pre><code> var url = 'http://XXXXXXX.xml';
   var xml = UrlFetchApp.fetch(url).getContentText();
   //how do I check the error here?
   var document = XmlService.parse(xml);
  </code></pre>
  
  <p>I tried checking xml for null, but that didn't work. I want to catch any error on the connection. I realize there is something that is easy here, but I am working outside my element.</p>