catch PHP errors

This commit is contained in:
Daniel Seifert 2024-08-22 11:06:35 +02:00
parent 7fbadf5d0c
commit e6eb559e8b

View File

@ -87,6 +87,13 @@ class MailConfigCheck extends AdminDetailsController
protected function getCurrentMailer(): void
{
set_error_handler(
function ($errno, $errstr, $errfile, $errline) {
throw oxNew(Exception::class, $errstr.' in '.$errfile.'('.$errline.')', $errno);
},
E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
);
try {
$shop = Registry::getConfig()->getActiveShop();
@ -114,5 +121,7 @@ class MailConfigCheck extends AdminDetailsController
ob_end_clean();
Registry::getUtilsView()->addErrorToDisplay($e);
}
restore_error_handler();
}
}