 <p>You have created list of exceptions, i.e. list that can hold instances of exceptions. But you try to add there <code>class</code> instead. </p> <p>the following will work </p> <pre><code>List&lt;Exception&gt; ex = new ArrayList&lt;Exception&gt;(); ex.add(new NotFoundException()); </code></pre> <p>(obvioously if your <code>NotFoundException</code> has default constructor; otherwise use appropriate contructor). </p> <p>The following will work too: List> ex = new ArrayList>(); ex.add(NotFoundException.class);</p> <p>now it depends what do you really need. </p>