Python exception base class vs. specific exception
<p>I just wonder, when using try.. except, what's the difference between using the Base class "Except" and using a specific exception like "ImportError" or "IOError" or any other specific exception. Are there pros and cons between one and the other?</p>

<p>Of course it has advantages using the correct exception for the corresponding issue. However Python already defined all possible errors for coding problems. But you can make your own exception classes by inheriting from the <code>Exception</code> class. This way you can make more meaningful errors for spesific parts of your code. You can even make the expections print errors like this.</p>

<pre><code>SomeError: 10 should have been 5.
</code></pre>

<p>Provides easier debugging of the code.</p>

<p><a href="http://stackoverflow.com/questions/1319615/proper-way-to-declare-custom-exceptions-in-modern-python">For more info.</a></p>

python exception exception-handling