CodeIgniter Forums
API Exceptions & Detailed Errors Shown in Production Environment CI 4.04 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: API Exceptions & Detailed Errors Shown in Production Environment CI 4.04 (/showthread.php?tid=78033)



API Exceptions & Detailed Errors Shown in Production Environment CI 4.04 - myo - 11-22-2020

Hi,

I am using version. 4.04 I created some restful APIs and was checking the exception handling by using wrong controller names etc in PRODUCTION environment.

To my surprise its showing detailed errors while I have already set environment to production in .env file. In the browser its not showing anything but in postman its sending detailed error reports.

Do I need to make any further changes to stop this detailed error reporting in APIs.

Regards


RE: API Exceptions & Detailed Errors Shown in Production Environment CI 4.04 - InsiteFX - 11-22-2020

You could try setting it in the .htaccess file at top.


SetEnv CI_ENVIRONMENT 'production'