forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Williams <william...@gmail.com>
Subject location resolution error handling
Date Tue, 28 Jun 2005 13:19:54 GMT
The more I think about Ross' suggestion in FOR-554,
http://issues.apache.org/jira/browse/FOR-554?page=comments#action_12314597
 the more I like it. While I think that cocoon should be giving us a
proper exception, even if we get that an there is a proper error
message it'll still be incomplete.  The reason is that if we looked in
4 or 5 different places for a particular resource the
SourceNotFoundException is only going to highlight the last location.

It seems to me that a proper error message would enumerate the
attempted locations so that the user doesn't need to know the sitemap
matching order. For example, consider the following snippet:
<map:when test="{project:content.xdocs}tabs.xml">
   <map:generate src="{project:content.xdocs}tabs.xml"/>
</map:when>
<map:otherwise>
   <map:generate src="{lm:tabs.xml}"/>
</map:otherwise>

I would think the error message that comes back if neither of these is
found would be something to the effect of:

"We attempted the following locations and the source file could not be found.
1.  {project:content.xdocs}tabs.xml
2.  {lm:tabs.xml}"

Instead of a SourceNotFound for just the last entry.  The resources
are even worse because they attempt quite a few different places.

I'll continue on my current path of getting a reasonable error message
out but thought I throw this out for consideration. Thoughts?

--tim

Mime
View raw message