Pre-Process ReplicationException Custom Error Message | Community
Skip to main content
Level 2
September 24, 2019
Solved

Pre-Process ReplicationException Custom Error Message

  • September 24, 2019
  • 9 replies
  • 6572 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by mrpoofy

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

9 replies

Adobe Employee
September 24, 2019

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#CreateaCustomLogFile

mrpoofyAuthor
Level 2
September 24, 2019

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.

September 24, 2019

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

mrpoofyAuthor
Level 2
September 24, 2019

Hi Santhi!

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

Level 2
September 24, 2019

Are you using classic or touch UI?

mrpoofyAuthor
Level 2
September 24, 2019

I'm using touch ui on AEM 6.5

Level 2
September 24, 2019

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

mrpoofyAuthor
Level 2
September 24, 2019

Hi Santhi!

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

mrpoofyAuthorAccepted solution
Level 2
September 24, 2019

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