F
Filament10mo ago
Luca

Please Help! Why does Filament show a modal error for form operation errors ?

What I am trying to do: I am trying to understand the behavior of Filament's error handling during form operations. What I did: I have been using Filament and noticed that it displays different types of error pages for different issues. My issue/the error: I set .env APP_DEBUG=false. When an error occurs during a form operation, Filament shows a modal error page, e.g., 500 error. However, when there is a permission error, it shows a full-page error. I am trying to understand the reason behind this difference in error handling. Code: N/A
Solution:
Livewire throws errors in a modal because they are happening in an Ajax request. The full page error is when laravel throws an exception during the normal application flow.
Jump to solution
11 Replies
Vp
Vp10mo ago
afaik filament don't handle this kind of error, livewire/laravel did. and what is your APP_ENV?
Luca
LucaOP10mo ago
Thank you for your response! My APP_ENV is set to production.
Vp
Vp10mo ago
can you show what kind of permission error showing in full page when APP_ENV=production and app_debug=false
Luca
LucaOP10mo ago
For example, after enabling multi-tenancy, if you try to access a tenant you don't have permission for, you will get a 403 full-page error.
No description
Luca
LucaOP10mo ago
Another type of error is a modal error. For example, if there is a field start_date of type timestamp, due to the MySQL 2038 issue, saving a date beyond 2038 will result in an error.
Luca
LucaOP10mo ago
No description
No description
toeknee
toeknee10mo ago
Enable debug mode, see what the error is. Where is your model?
Luca
LucaOP10mo ago
I would like to understand why sometimes the error appears as a modal instead of a full-page error.
toeknee
toeknee10mo ago
One will be when editing in a modal, or by an ajax request A new page, is when submitting/rendering a page I suspect the errors are different, 500 just means server coding issue.
Solution
awcodes
awcodes10mo ago
Livewire throws errors in a modal because they are happening in an Ajax request. The full page error is when laravel throws an exception during the normal application flow.
Luca
LucaOP10mo ago
I appreciate it. Thanks! ❤️

Did you find this page helpful?