Reputation: 1682
I get a
Fatal error: Class 'AException' not found in
when I throw an exception with a different name than 'Exception':
try
{
if ( something ) throw new AException('Error');
}
catch (AException $e)
{
$e->getMessage();
}
But if I change AException
with Exception
it works.
Any help please?
Upvotes: 0
Views: 94
Reputation: 2456
You need to create a class for every custom exception.
ref: http://php.net/manual/en/language.exceptions.extending.php
Upvotes: 1