-2
I’m trying to treat the native mistakes of PHP in case something goes unnoticed, the error is treated and show a message in a more user-friendly way, but even using the Throwable in the try catch, it just bursts the error and does not fall into the catch.
I’ve tried with Exception, ErrorException Throable but none works, and I can’t understand what’s wrong.
Error example:
function logar($objectFactoryGeral,$toGeral){
try {
$SBLogin = $objectFactoryGeral->SBC_Usuario()->SBLogin();
$email = 59/0;//.$_REQUEST['email'];
//$senha = $_REQUEST['senha'];
$toLogin = $toGeral->ITOLogin($email,$senha);
$SBLogin->logar($toLogin);
} catch (Throwable $e) {
return RetornaExcecaoCOJS($e->getMessage());
}
}
Related: It is possible to manipulate PHP errors via code?
– Icaro Martins
From what I understand should, through Try catch.
– cezar c.a