Check if command had some trouble in Python?
<p>I have this command</p>

<pre><code>h = urllib.urlopen("http://google.com/")
</code></pre>

<p>How can I check if it retrieves me some error, internet down or something I don't expect?</p>

<p>For example, something like</p>

<p>if error
 print 'ERROR'</p>

<p>Thank you</p>
