Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Pre-Process ReplicationException Custom Error Message

Avatar

Level 2

Hi i'm working with AEM 6.5 and i created a Pre-Process for the page activation.

When some parameter is not configured i'm throwing a Replication Exception with a message. The message appears correctly for the user but it adds a list with all the paths of content that was not published because of the error.

Is there any way i can customize that error message to remove or even filter the paths that can be shown in the error message? And where can i do it?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi again Santhi!

You are correct, i took a look at the files. And indeed it's there that we can control the error message. But like you said it's not recommended to change anything in there.

The error message is being populated from the com.day.cq.replication.impl.servlets.CommandServlet, with the response:

Santhi Swaroop

So the only way i can see to change the message, is changing the com.day.cq.replication.impl.servlets.CommandServlet or changing the Javascript classes for /libs/cq/gui/components/common/wcm/clientlibs/wcm/js/quickpublish.js and /libs/cq/gui/components/common/admin/managepublication/clientlibs/managepublication/js/managepublication.js

View solution in original post

9 Replies

Avatar

Employee Advisor

You can try to define a custom logging writer and define the messages as per your requirement. Check [1] for more details.

[1] https://helpx.adobe.com/experience-manager/6-3/sites/deploying/using/monitoring-and-maintaining.html...

Avatar

Level 2

Hi JaideepBrar​, i don't want to create a log with a custom message.

I want to change the message that is shown in a pop-up to the user when the ReplicationException is thrown.

Avatar

Level 1

You would need to overlay the jsp that is handling the response for activation

Avatar

Level 2

Hi Santhi!

I already tried to search for something of the sorts, but i can't find the correct one.

Avatar

Level 3

Please take a look at /libs/cq/gui/components/common/wcm/clientlibs/wcm/js/quickpublish.js and /libs/cq/gui/components/common/admin/managepublication/clientlibs/managepublication/js/managepublication.js

I don’t know if this is a best practice to overlay above as you would need to keep track of these during upgrades of aem. Or try to have your own clientlib which can get the hook on client side and modify the message on UI with some query code.

Thanks

Avatar

Level 2

Hi Santhi!

Thanks for the info. I will look into it and come back to you.

Avatar

Correct answer by
Level 2

Hi again Santhi!

You are correct, i took a look at the files. And indeed it's there that we can control the error message. But like you said it's not recommended to change anything in there.

The error message is being populated from the com.day.cq.replication.impl.servlets.CommandServlet, with the response:

Santhi Swaroop

So the only way i can see to change the message, is changing the com.day.cq.replication.impl.servlets.CommandServlet or changing the Javascript classes for /libs/cq/gui/components/common/wcm/clientlibs/wcm/js/quickpublish.js and /libs/cq/gui/components/common/admin/managepublication/clientlibs/managepublication/js/managepublication.js