Replies: 1 comment
-
|
@gyaaniguy Inertia always shows the modal (or the dialog) when there was
use Illuminate\Foundation\Configuration\Exceptions;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Validation\ValidationException;
...
->withExceptions(function (Exceptions $exceptions) {
$exceptions->render(function (Error|HttpException|Throwable $e) {
if (!($e instanceof ValidationException)) {
$code = 500;
if ($e instanceof HttpException) {
$code = $e->getStatusCode();
}
return response(null, $code, [
'X-Inertia' => true // or false, or any other value, it doesn't matter
]);
}
});
})But I can't be sure if this is a good option. I would like to note separately that the exception to this behavior is if the response code is 409 and the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When uploading a file, that is larger than what is allowed by the web-server. The request never reaches laravel.

So instead of a InertiaResponse, we get a html response.
I understand this causes Inertia to show a huge modal, with the error html.
I feel this is less than ideal. The modal should be optional, I should be able to catch such a situation and instead show a styled message or alert box. Is this possible ? Or any other way to do it ?
Beta Was this translation helpful? Give feedback.
All reactions