You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Stavrinides <P....@albourne.com> on 2010/03/08 09:40:50 UTC

Exception handling

Hi everyone,

I am having a problem with the following scenario:

- A page renders a grid with a number of links
- Clicking one of those links causes the page to re-render, but it breaks with the following exception:

 ERROR com.test.CoreModule.SiteRequestExceptionHandler Render queue error in BeforeRenderTemplate[hf/Fund:select]: Failure reading parameter 'encoder' of component hf/Fund:select: It is not permitted to add duplicate elements to a BeanListModel 
org.apache.tapestry5.internal.services.RenderQueueException: Render queue error in BeforeRenderTemplate[hf/Fund:select]: Failure reading parameter 'encoder' of component hf/Fund:select: It is not permitted to add duplicate elements to a BeanListModel [at classpath:com/test/pages/hf/Fund.tml, line 186]
	at org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:86)
	at org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121)
	at $PageRenderQueue_1273cc4eea2.render($PageRenderQueue_1273cc4eea2.java)
	at $PageRenderQueue_1273cc4ee99.render($PageRenderQueue_1273cc4ee99.java)
	at org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)
	at org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1748) 
...

- What caused this error was my bean, which threw it when a problem occurred sorting the primary keys, this is all fine so far.
- The trouble is it breaks before re-rendering the page in BeforeRenderTemplate, which means the page never gets a chance to recover / report the exception (i.e.: onException is never invoked)

So my question is what approach can I take to intercept *only these exceptions that don't make it to the page. I rely heavily on onException at the moment, so I don't want to stop using it if possible, the ideal would be to have a new way of intercepting and dealing with these cases, perhaps two distinct mechanisms:
1. For exceptions that don't reach the page / component - taken care of by some new system (sub-system A)
2. Exceptions that do reach the page - remains as is, handled by onException() handler (sub-system B)

Is this possible, any ideas? 

Thanks,
Peter



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Exception handling

Posted by Peter Stavrinides <P....@albourne.com>.
This is not what I am asking Thiago, I already have my own error page.

Thanks,
Peter

-- 
If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail.

----- Original Message -----
From: "Thiago H. de Paula Figueiredo" <th...@gmail.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Monday, 8 March, 2010 15:21:45 GMT +02:00 Athens, Beirut, Bucharest, Istanbul
Subject: Re: Exception handling

On Mon, 08 Mar 2010 05:40:50 -0300, Peter Stavrinides  
<P....@albourne.com> wrote:

> Hi everyone,

Hi!

> So my question is what approach can I take to intercept *only these  
> exceptions that don't make it to the page.

Create your own error page. It must implement the ExceptionReporter  
interface. Set the tapestry.exception-report-page configuration symbol to  
the logical name of your error page.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Exception handling

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 08 Mar 2010 05:40:50 -0300, Peter Stavrinides  
<P....@albourne.com> wrote:

> Hi everyone,

Hi!

> So my question is what approach can I take to intercept *only these  
> exceptions that don't make it to the page.

Create your own error page. It must implement the ExceptionReporter  
interface. Set the tapestry.exception-report-page configuration symbol to  
the logical name of your error page.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org