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
Vp5mo ago
afaik filament don't handle this kind of error, livewire/laravel did. and what is your APP_ENV?
ZongYing
ZongYingOP5mo ago
Thank you for your response! My APP_ENV is set to production.
Vp
Vp5mo ago
can you show what kind of permission error showing in full page when APP_ENV=production and app_debug=false
ZongYing
ZongYingOP5mo 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
ZongYing
ZongYingOP5mo 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.
ZongYing
ZongYingOP5mo ago
No description
No description
toeknee
toeknee5mo ago
Enable debug mode, see what the error is. Where is your model?
ZongYing
ZongYingOP5mo ago
I would like to understand why sometimes the error appears as a modal instead of a full-page error.
toeknee
toeknee5mo 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
awcodes5mo 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.
ZongYing
ZongYingOP5mo ago
I appreciate it. Thanks! ❤️
Want results from more Discord servers?
Add your server