Call to undefined method Exception::getSeverity()
<p>I am using <a href="http://www.php.net/manual/en/class.errorexception.php" rel="nofollow">ErrorException</a> as my central error handling function for Errors and Exception:</p>

<p>Example:</p>

<pre><code>set_error_handler('my_error_handler');
set_exception_handler('my_exception_handler');    

function my_error_handler ($errno, $errstr, $errfile, $errline)
{
    my_exception_handler(new ErrorException($errstr, 0, $errno, $errfile, $errline));
}

function my_exception_handler ($e)
{   
    echo $e-&gt;getSeverity();
    echo $e-&gt;getCode();
    echo $e-&gt;getMessage();          
}
</code></pre>

<p>Now it appears <code>$e-&gt;getSeverity();</code> is only present in <code>ErrorException</code> and not in the default <code>Exception</code>;</p>

<p>Because when I <code>throw new Exception('test');</code> I get a <code>Fatal error: Call to undefined method Exception::getSeverity()</code>.</p>

<p>But when I <code>throw new ErrorException('test');</code> it works as expected.</p>

<p>This seems logical but is there a way I can still use <code>throw new Exception('test');</code> without getting the Fatal Error? Most third-party libraries use Exception (not ErrorException) so it will be problematic when a third-party exception occurs, it will cause Fatal Error. How can I solve this?</p>
