Perhaps this is a namespace.
If SmsExceptiondefined in a namespace, for example:
<?php namespace App\Exceptions;
class SmsException extends \Exception {
}
and the code that tries to catch the exception is defined in another namespace or is missing at all, for example:
<?php App\Libs;
class MyLib {
public function foo() {
try {
$activationService = new ActivationService();
$activationService->send($request->phone);
} catch (SmsException $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}
}
App\Libs\SmsException, , catch .
, catch (SmsException $e) catch (\App\Exceptions\SmsException $e) (, ) use .
<?php App\Libs;
use App\Exceptions\SmsException;
class MyLib {