From 0bdeee43d18e0e532e37c8cccc8f7939bab96c23 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 20 May 2015 12:05:13 +0000 Subject: [PATCH] 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 --- .../web-scripts-application-context.xml | 5 ++++ .../repo/web/scripts/RepositoryContainer.java | 23 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml index e99291e060..1dda62127e 100644 --- a/config/alfresco/web-scripts-application-context.xml +++ b/config/alfresco/web-scripts-application-context.xml @@ -141,6 +141,11 @@ org.alfresco.service.cmr.repository.ContentIOException + + + org.alfresco.repo.content.ContentLimitViolationException + + diff --git a/source/java/org/alfresco/repo/web/scripts/RepositoryContainer.java b/source/java/org/alfresco/repo/web/scripts/RepositoryContainer.java index 5246eeb180..d5f160db54 100644 --- a/source/java/org/alfresco/repo/web/scripts/RepositoryContainer.java +++ b/source/java/org/alfresco/repo/web/scripts/RepositoryContainer.java @@ -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}<?>[] instance which contains list of public exceptions + */ + public void setPublicExceptions(List> 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)