20240423#5

This commit is contained in:
User
2024-04-23 05:41:46 +03:00
parent 98c2d37870
commit de10cbae31
2 changed files with 11 additions and 15 deletions

View File

@@ -2,6 +2,7 @@
namespace Base\Controllers;
use Base\Domain\DomainException;
use Base\Services\DTOException;
use Base\Services\ServiceException;
use Exception;
@@ -28,7 +29,7 @@ abstract class AbstractPageController extends AbstractController {
*/
public function checkError(Throwable $e) : string {
($e instanceof Exception) ? $this->logException($e) : $this->logError($e);
if($e instanceof DTOException || $e instanceof ServiceException) return $e->getMessage();
if($e instanceof DTOException || $e instanceof DomainException || $e instanceof ServiceException) return $e->getMessage();
return "Ошибка. Дата и время: ".date("d-m-Y H:i:s");
}
}