Level 60
Jan 8, 2020
2
Level 23
Exception Handler and Session
Hello,
I would like to catch a PostTooLargeException in the render method of Handler.php file. so I did :
public function render($request, Exception $exception)
{
if ($exception instanceof PostTooLargeException) {
return redirect('mypage')->with('toobig', "File too big. 30Mo max.");
}
return parent::render($request, $exception);
}
But in my view, nothing is in the session.
I tried to manually throw a ValidationException, but, in the view, the $errors variable is empty too.
throw ValidationException::withMessages([
'file' => ["File too big. 30Mo max."],
]);
thanks!
Anyone has an idea?
(Laravel 5.8.10)
Please or to participate in this conversation.