We also had similar problem, later we extended the AlfrescoRuntimeException to our own custom class.
In this way,we're not displaying "org.Activiti.Exception…" and we're displaying own error message like 'com.quanticate….'.
<java>
public class CustomWorkflowException extends AlfrescoRuntimeException
{
protected static final String UNKNOWN_MESSAGE = "CustomWorkflow.exception.unknown";
protected static final String START_MESSAGE = "CustomWorkflow.exception.start";
private static final long serialVersionUID = 2163551047437476248L;
private String msgId;
private String message;
/**
* Constructor
*
* @param msgId the message id
*/
public CustomWorkflowException(String msgId)
{
super(msgId);
this.message = resolveMessage(msgId, null);
this.msgId = msgId;
}
/**
* Constructor
*
* @param msgId the message id
* @param cause the exception cause
*/
public CustomWorkflowException(String msgId, Throwable cause)
{
super(msgId, cause);
this.message = resolveMessage(msgId, null);
this.msgId = msgId;
}
/**
* @return the msgId
*/
public String getMsgId()
{
return msgId;
}
@Override
public String getMessage()
{
return getLocalizedMessage();
}
@Override
public String getLocalizedMessage()
{
return message;
}
@Override
public String toString()
{
return I18NUtil.getMessage(START_MESSAGE) + " " + message;
}
/**
* Resolves the message id to the localised string.
* <p>
* If a localised message can not be found then the message Id is
* returned.
*
* @param messageId the message Id
* @param params message parameters
* @return the localised message (or the message id if none found)
*/
private static String resolveMessage(String messageId, Object[] params)
{
String message = I18NUtil.getMessage(messageId, params);
if (message == null)
{
// If a localised string cannot be found then return the messageId
message = messageId;
}
if (message == null || message.isEmpty())
{
// If there's no know message, pick the default unknown one
message = I18NUtil.getMessage(UNKNOWN_MESSAGE);
}
return message;
}
}
</java>
Hope this helps someone.