Requiring Article Decorators to Succeed

If for some reason an article decorator fails to complete due to an error, then by default the error is logged, but no other action is taken and the presentation process continues as if it had succeeded. This is acceptable behavior in many cases, but not all. If, for example, a decorator that is part of a paywall solution fails, then you may not want the affected content item to be displayed.

You can therefore configure article decorators to fail on error by adding a fail-on-error attribute to the ui:decorator element as follows:

<ui:decorator name="paywallCheck" fail-on-error="true"/>

Now if the decorator fails, an error will be logged in the usual way but in addition the presentation system will attempt to hide the affected content item. The content item will not be accessible on its URL, nor will it appear on any section page.

A content item cannot, however, be hidden completely if there are already links to it in search indexes. If this is the case and if it is requested frequently then large numbers of errors may be added to the error log. Since the page has not been displayed, it will not have been cached either, so every request will cause the decorator to be executed and potentially fail, resulting in a new error being logged.

If this becomes a problem, operations staff can work around it either by temporarily caching the HTTP 404 error page or by temporarily disabling ERROR logging for neo.xredsys.presentation.AbstractArticlePresentationManager.

Fail-on-error functionality is only available for article decorators, not for pool decorators.