Magento Tutorials

Exception printing is disabled by default for security reasons

What is “Exception printing is disabled by default for security reasons”?

As explained in this similar tutorial There has been an error processing your request, this is a common error message that you will encounter when working with Magento. Note that the message in itself is NOT an error, but rather a notification on some errors occurring in your system. As it is caused by potential conflicts between internal components of Magento and/or caching issues, you may encounter this error message when installing a new Magento theme/module.

magento exception printing

How to solve this?

First, if you’re not involved with managing your server and your Magento backend, it might be worth it to check with your developers to see if they’re doing on the Magento backend. It is likely that your developers might be troubleshooting things on your Magento backend which leads to this error message.

In short, there are two main ways to solve this error message: (1) clear your cache and (2) enable printing errors. Now we’ll go into details on each solution.

1. Clear your cache

Clearing your cache oftentimes can make this error message go away for good.  To clear your cache, access your Magento installation folder, go to var/cache and delete all the files there.

magento cache folder

Alternatively, you could also go to your Magento admin and navigate to System > Cache Management > Flush Cache Storage.

Flush cache storage Magento 2

Then, refresh your Magento site to see if the error message is gone.

Don’t skip this guide to know how to Enable/Disable OR Clear Cache in your Magento 2-based online stores.

2. Enable exception printing errors

If the above method doesn’t work, then you need to enable printing errors to find out what the exact problems are and solve them.

To enable printing errors, first you’ll need to switch your store to developer mode using:

php bin/magento deploy:mode:set developer

And then, go to the /pub/errors folder in your Magento 2 directory and change the name of this file:

local.xml.sample

to local.xml.

Next, refresh your error page and you should be able to see a list of errors like so:

[2020-12-12 22:35:20] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:24)"} []

Now you have the specific errors you need to debug! And in case you find it too confusing, don’t hesitate to ask for help in the comment section below.

If you want to find out more about Magento 1 & 2, we have exclusive tutorials for you to learn all about this amazing platform.