[
http://jira.jboss.com/jira/browse/JBIDE-1280?page=comments#action_12399367 ]
Viacheslav Kabanovich commented on JBIDE-1280:
----------------------------------------------
Sergey, I do not agree that templates are just an internal VPE functionality.
Templates in VPE are in general very advanced and user friendly framework, and are nearer
to be API than many other features in Studio.
We encourage users to add their custom tag libraries to our palette, and VPE templates
give them opportunity to adjust view for their specific tags.
User friendly error handling is one of important features that can make templates
framework attractive, while it is relatively easy to implement, comparing to what is
already done.
JBoss Tools JSP Editor does not process some problems in vpe
templates in a user friendly way
---------------------------------------------------------------------------------------------
Key: JBIDE-1280
URL:
http://jira.jboss.com/jira/browse/JBIDE-1280
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: Visual Page Editor
Affects Versions: 2.0.0.Beta4
Reporter: Viacheslav Kabanovich
Assigned To: Sergey Vasilyev
Priority: Critical
Fix For: 2.1
1. provide an incorrect vpe expression in some vpe template.
(I used <span title="{tagstring()|tagstring()}" /> instead of <span
title="{tagstring()}" />
for standard jsf tag templates in vpe-templates-jsf.xml).
2. prepare jsp file that uses the corrupted template.
3. open jsp file with JBoss Tools JSP Editor.
Result: blank visual editor and empty Eclipse log.
4. Select Preview tab
Result: tab is empty and log contains Error
org.jboss.tools.vpe.editor.template.expression.VpeExpressionError: Error of type
conversion
at org.jboss.tools.vpe.editor.template.expression.VpeValue.or(VpeValue.java:94)
at
org.jboss.tools.vpe.editor.template.expression.VpeOrOperation.exec(VpeOrOperation.java:26)
at
org.jboss.tools.vpe.editor.template.VpeAttributeCreator.create(VpeAttributeCreator.java:54)
The Error is caught by Workbench.
The question is: why most problems in vpe expressions throw VpeExpressionBuilderException
and some problems throw VpeExpressionError (which extends java.lang.Error)?
Comment to java.lang.Error says that
"An Error is a subclass of Throwable that indicates serious problems
that a reasonable application should not try to catch"
As shown above, in cases when Studio does not catch VpeExpressionError, user has no idea
what is wrong,
and in cases when Eclipse catches it, it would be more proper to use something like
VpeExpressionExecException extending Exception rather than Error.
Solution:
I think we should create VpeExpressionException that extends RuntimeException. Templates
it is a part of VPE functionality and doesn't have any user input. And we will have
all of template's bugs caught.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira