If database is not available there is some seconds of loading. Then the log shows this error, should'nt that trigger the exception handler? (other errors end up their as expected)
[2021-04-14 13:01:40] production.ERROR: SQLSTATE[HY000] [2002] Connection timed out (SQL: SELECT * FROM `list` LIMIT 1) (View: /opt/app-root/src/resources/views/err1.blade.php) {"exception":"[object] (Facade\\Ignition\\Exceptions\\ViewException(code: 0): SQLSTATE[HY000] [2002] Connection timed out (SQL: SELECT * FROM `list` LIMIT 1)
Then I see "504 Gateway Time-out The server didn't respond in time." Error. How do I configure eloquent so a database timeout throws a regular exception? (so the handler can show a more appealing standdard error page)
I tried to set the PDO options to PDO::ERRMODE_EXCEPTION in config/database.php and then php artisan config:clear but it did not work.
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'forge'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
'options' => [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,]
],