How Can I show a custom view instead of the generic error attached in cases of the database going down unexpectedly?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
In applications folder there is a folder named errors. There are all error files
which comes up when an error is occurred.
When database error is occured, error_db.php file is shown in browser. You can edit it or replace that with your custom file.
Hope this helps.
回答2:
You should set $db_debug = FALSE;
in your config database settings on your production server - you should NEVER show a raw database error message to your users, as it is a massive security risk
标签:
codeigniter