cancel
Showing results for 
Search instead for 
Did you mean: 

want to show error message thrown from java in share page

kranthi
Star Contributor
Star Contributor

Hi all,

Want to show error message thrown from java in share page.

Tried like :

         throw new Exception("Email-id already exists..! Please try with different email-id");

         throw new AlfrescoRuntimeException("Email-id already exists..! Please try with different email-id");

How to show exceptions in share??

2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator

It always depends on the context that you are referring to. Are we talking about document library actions, or just arbitrary pieces of code calling the Repository-tier? Generally speaking, it is the responsibility of the client-side code (Share JavaScript) to show proper error messages. Most of the generic handling (i.e. document library actions) will simply show a generic error, unless you override the error handler via custom JavaScript.

Also, depending on the context of your Java code, some exception may simply not bubble up to the Share tier. This for example applies to transaction-level behaviours which will have any exceptions wrapped up in a very generic, technical exception, so the error message sent back to Share ultimately does not contain any useful information.

kranthi
Star Contributor
Star Contributor

Actually wrote behaviour for avoiding duplication of email-id at the time of user creation.So tried like that to throw exception.

Alternatively need to write webscript that need to be call in users-min.js to show exception right ??