Answer the question
In order to leave comments, you need to log in
Why doesn't Laravel's custom exception work?
IndexController.php:
public function testException(){
try{
echo $test;
}
catch(Exception $e) {
throw new
PostsInCategoryNotFoundErrorException($e);
}
}
namespace App\Exceptions;
use Exception;
class PostsInCategoryNotFoundErrorException extends Exception
{
}
public function render($request, Exception $exception)
{
if ($exception instanceof PostsInCategoryNotFoundErrorException) {
echo 'Ошибка в переменной';
}
return parent::render($request, $exception);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question