Strange NotFound errors in Plone 5 templates

We have found that sometimes when there is some kind of error in our templates or in the view code, Plone 5 returns 404 error instead of showing a proper traceback.

Today, for instance, I have registered a portlet with an incorrect name and when going to the portlet management screen I was receiving a 404 Not Found error instead of a traceback.

Yesterday I had an error in a method name of the view class and it showed a 404 error.

Is this a chameleon feature? Or am I missing something here?

Check your __init__() method and move any code that could rise exceptions to a setup() method called from __call__(); see the documentation:

Do not attempt to run any code in the __init__() method of a view. If this code fails and an exception is raised, the zope.component machinery remaps this to a "View not found" exception or traversal error.

2 Likes