}
else
{
PortletContainerException pcException;
if (response instanceof ErrorResponse)
{
ErrorResponse errorResponse = (ErrorResponse)response;
pcException =
new PortletContainerException(errorResponse.getMessage(), errorResponse.getCause());
}
else
{
pcException =
new PortletContainerException("Unknown invocation response type [" + response.getClass()
+ "]. Expected a FragmentResponse or an ErrorResponse");
}
PortletExceptionHandleService portletExceptionService =
(PortletExceptionHandleService)container
.getComponentInstanceOfType(PortletExceptionHandleService.class);
portletExceptionService.handle(pcException);
markup = Text.create("This portlet encountered an error and could not be displayed.");
}
}
}
}
}
catch (Exception e)
{
PortletContainerException pcException = new PortletContainerException(e);
PortletExceptionHandleService portletExceptionService =
(PortletExceptionHandleService)container.getComponentInstanceOfType(PortletExceptionHandleService.class);
if (portletExceptionService != null)
{
portletExceptionService.handle(pcException);