cancel
Showing results for 
Search instead for 
Did you mean: 

Web client error handling with Java

simon
Champ in-the-making
Champ in-the-making
Alfresco,

I'm writing my own bean and I'm looking for a way to do error handling. This is what I found so far:
throw new AlfrescoRuntimeException("The space exists, find another name.");
This triggers a runtime exception but a duplicate name for a space is certainly no runtime problem it's a user message. Any idea how I can trigger the "yellow error boxes" in the web client?

Thanks!
3 REPLIES 3

simon
Champ in-the-making
Champ in-the-making
*bump*

kevinr
Star Contributor
Star Contributor
I assume you mean this kind of thing:

catch (Throwable err)
{
   Utils.addErrorMessage("some error message - probably generated", err);
}

The exception 'err' is an optional parameter for the exception to be logged to the console.

Thanks,

Kevin

simon
Champ in-the-making
Champ in-the-making
Great, thanks Kevin!