Fórum

Display standard message when exception occurs in portlet

Eric Smith, modificado 9 Anos atrás.

Display standard message when exception occurs in portlet

Junior Member Postagens: 66 Data de Entrada: 28/08/12 Postagens Recentes
I'd like to display a standard user-friendly error message in a portlet on exception, and write the exception specific details to a log file. Where do I add this code?

I've tried creating a portlet that throws an exception, which does show up in the log. However the resulting portlet has an empty body. I tried tracing the code to find the catch that handles the exception, but I haven't been able to find it. I started in render_portlet.jsp and got as far as InvokerPortletImp.java.

Thanks in advance

Eric
Eric Smith, modificado 9 Anos atrás.

RE: Display standard message when exception occurs in portlet

Junior Member Postagens: 66 Data de Entrada: 28/08/12 Postagens Recentes
Thanks Jeffrey.

I saw that, but it's not quite what I'm looking for. That's for customizing messages in Liferay portlets, which we're definitely doing. However, we're also using Vaadin portlets.

What I'm really looking for is a place in the Liferay code that catches all uncaught exceptions thrown by portlets. Does that exist?
thumbnail
Jack Bakker, modificado 9 Anos atrás.

RE: Display standard message when exception occurs in portlet

Liferay Master Postagens: 978 Data de Entrada: 03/01/10 Postagens Recentes
Eric Smith:
I'd like to display a standard user-friendly error message in a portlet on exception


Eric Smith:
What I'm really looking for is a place in the Liferay code that catches all uncaught exceptions thrown by portlets


The two above are different requests.

Jeff answered for the first one and as you likely know Vaadin has its own messaging to end user available.

Sounds like after logging as usual, you might, on exception to redirect to an error page which has a picture of a bleeding belly-button or something where people wonder what that means wrt to the portlet they were working in...
Eric Smith, modificado 9 Anos atrás.

RE: Display standard message when exception occurs in portlet

Junior Member Postagens: 66 Data de Entrada: 28/08/12 Postagens Recentes
Jack, I didn't explain my situation very well so Jeffrey misunderstood. My 2nd post better describes what I'm trying to accomplish.

I've setup a test scenario, throwing an uncaught PortletException from an asset publisher.

By default, the stack trace is written to the log. However the portlet body is empty. I'd like to change this so that the portlet body contains an error message, and possibly tweak the logging. Is there somewhere in the Liferay code that I can do this?

Thanks.