I\'m trying to catch exceptions from a set of tests I\'m running on an API I\'m developing and I\'m using Guzzle to consume the API methods. I\'ve got the tests wrapped in a
In my case I was throwing Exception on a namespaced file, so php tried to catch My\Namespace\Exception therefore not catching any exceptions at all.
Exception
My\Namespace\Exception
Worth checking if catch (Exception $e) is finding the right Exception class.
catch (Exception $e)
Just try catch (\Exception $e) (with that \ there) and see if it works.
catch (\Exception $e)
\