Library thrown exceptions
<p>I have project as a "library" which does HttpCommunication. I post data into it and receive response. Lib's method can throw several exceptions which I want catch in the hosted app, but somehow I can catch only general Exception instead of specific once.</p>

<p>Library method code:</p>

<pre><code> public byte[] execute(String entityStr) throws UnsupportedEncodingException, 
        ClientProtocolException, IOException
{
    ...
    // some code that can throw mentioned exceptions
}
</code></pre>

<p>Hosted class:</p>

<pre><code>try {

    byte[] response = httpClient.execute(profile);
} catch (Exception e) {

    e.printStackTrace();
}
</code></pre>

<p>code above compiles, but code below does not. </p>

<pre><code>try {

    byte[] response = httpClient.execute(profile);
} catch (UnsupportedEncodingException e) {

} catch (ClientProtocolException e) {
}
</code></pre>

<p>Exception objects marked as errors, messages say</p>

<p>Unreachable catch block for UnsupportedEncodingException. This exception is never thrown from the try statement body.</p>

<p>Hosted class is an Activity. Communication done in AsyncTask class.
If anybody knows what's wrong with it, explain me please.</p>
