I use a single Closure to handle exceptions in my app:
App::error(function(Exception $exception, $code)
{
if (is_a($exception, 'MsgException')) {
...
return;
}
dd($exception); // debugging
});
The strange thing is that if I throw a MsgException
...
<?php use MsgException; // alias for ExampleNamespace\MsgException
...
throw new MsgException();
...which is a custom class...
<?php namespace ExampleNamespace;
use RuntimeException;
class MsgException extends RuntimeException {}
... is_a($exception)
is false
and dd($exception)
says it's an ErrorException
.
I have no idea why this is happening. Any suggestions or ideas how I can debug my application?