Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

104564: Merged DEV to HEAD-BUG-FIX (5.1/Cloud)
      104487 : ACE-3949 : Non-specific message if maximumFileSizeLimit is exceeded
         - Added list of public exceptions


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@104638 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-05-20 12:05:13 +00:00
parent c70953278a
commit 0bdeee43d1
2 changed files with 27 additions and 1 deletions

View File

@@ -91,6 +91,7 @@ public class RepositoryContainer extends AbstractRuntimeContainer
private ThresholdOutputStreamFactory streamFactory = null;
private Class<?>[] notPublicExceptions = new Class<?>[] {};
private Class<?>[] publicExceptions = new Class<?>[] {};
/*
* Shame init is already used (by TenantRepositoryContainer).
@@ -197,6 +198,25 @@ public class RepositoryContainer extends AbstractRuntimeContainer
return notPublicExceptions;
}
/**
* Exceptions which may contain information that need to display in UI
*
* @param publicExceptions - {@link Class}&lt;?&gt;[] instance which contains list of public exceptions
*/
public void setPublicExceptions(List<Class<?>> publicExceptions)
{
this.publicExceptions = new Class<?>[] {};
if((null != publicExceptions) && !publicExceptions.isEmpty())
{
this.publicExceptions = publicExceptions.toArray(this.publicExceptions);
}
}
public Class<?>[] getPublicExceptions()
{
return publicExceptions;
}
/* (non-Javadoc)
* @see org.alfresco.web.scripts.Container#getDescription()
*/
@@ -282,7 +302,8 @@ public class RepositoryContainer extends AbstractRuntimeContainer
catch (RuntimeException e)
{
Throwable hideCause = ExceptionStackUtil.getCause(e, notPublicExceptions);
if (hideCause != null)
Throwable displayCause = ExceptionStackUtil.getCause(e, publicExceptions);
if (displayCause == null && hideCause != null)
{
AlfrescoRuntimeException alf = null;
if (e instanceof AlfrescoRuntimeException)