want to show error message thrown from java in share page

cancel
Showing results for 
Search instead for 
Did you mean: 
kranthi
Active Member II

want to show error message thrown from java in share page

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
afaust
Master

Re: want to show error message thrown from java in share page

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
Active Member II

Re: want to show error message thrown from java in share page

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 ??