title: The best way to check if Tab with exact ID exists in Chrome
body: <p>Sometimes there is tab Id stored in a variable and you need to check if tab still exists before doing something with it (because users can close tabs at any time). I've found this solution:</p>
  
  <pre><code>chrome.tabs.get(1234567, function(tab) {
    if (typeof tab == 'undefined') {
      console.log('Tab does not exist!');
    }
  });
  </code></pre>
  
  <p>It works but it has quite serious disadvantage. It writes error message into console like this:</p>
  
  <p><strong>Error during tabs.get: No tab with id: 1234567.</strong></p>
  
  <p>And this is not an exception. So try/catch can't help. It's just a message in console.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>UPDATE: This error now looks like "Unchecked runtime.lastError while running tabs.get: No tab with id: 1234567."</strong> </p>