From c53842aa33dc894dfb63cad49b11d62a8c2cb2f1 Mon Sep 17 00:00:00 2001 From: David Caruana Date: Thu, 7 Jun 2007 13:30:43 +0000 Subject: [PATCH] Web Scripts: - show full exception stack in default status response templates git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5882 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/templates/webscripts/status.ftl | 23 +++++++++++++++---- .../templates/webscripts/xml.status.ftl | 22 ++++++++++++++---- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/config/alfresco/templates/webscripts/status.ftl b/config/alfresco/templates/webscripts/status.ftl index 120d7b4ab7..7fa345363d 100644 --- a/config/alfresco/templates/webscripts/status.ftl +++ b/config/alfresco/templates/webscripts/status.ftl @@ -21,13 +21,26 @@ ${status.code} Description: ${status.codeDescription}   Message:${status.message!"<Not specified>"} - Exception:<#if status.exception?exists>${status.exception.class.name}<#if status.exception.message?exists> - ${status.exception.message} <#if status.exception?exists> -   - <#list status.exception.stackTrace as element> - ${element} - +   + <@recursestack status.exception/> + +<#macro recursestack exception> + <#if exception.cause?exists> + <@recursestack exception=exception.cause/> + + Exception:${exception.class.name}<#if exception.message?exists> - ${exception.message} +   + <#if exception.cause?exists == false> + <#list exception.stackTrace as element> + ${element} + + <#else> + ${exception.stackTrace[0]} + +   + diff --git a/config/alfresco/templates/webscripts/xml.status.ftl b/config/alfresco/templates/webscripts/xml.status.ftl index a46bd2d735..d7328eeddc 100644 --- a/config/alfresco/templates/webscripts/xml.status.ftl +++ b/config/alfresco/templates/webscripts/xml.status.ftl @@ -9,9 +9,23 @@ <#if status.exception?exists>${status.exception.class.name}<#if status.exception.message?exists> - ${status.exception.message} <#if status.exception?exists> - <#list status.exception.stackTrace as element> - ${element} - + <@recursestack status.exception/> - \ No newline at end of file + + +<#macro recursestack exception> + <#if exception.cause?exists> + <@recursestack exception=exception.cause/> + + <#if exception.cause?exists == false> + ${exception} + <#list exception.stackTrace as element> + ${element} + + <#else> + ${exception} + ${exception.stackTrace[0]} + +   +