Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-70166

Simplify error handling in MVCPortlet by dealing with all exceptions the same way


    • Story
    • Status: Closed
    • Minor
    • Resolution: Inactive
    • None
    • None
    • None


      Under some circunstamces, when there is an error in a portlet, the user is redirected to a new blank page with the message: X is temporarily unavailable

      It would be nicer if the portlet would handle that error in the same way it handles most errors keeping the user in the same UI where she is just pointing that something unexpected happened.

      Steps to test the Story:

      1. Add a new page
      2. As the name, use the ghost emoji. (Copy it from this page, JIRA doesn't support it either: https://www.emojibase.com/emoji/1f47b/ghost )
      3. Save --> This will take you to a blank page with the text: "Layouts Admin is temporarily unavailable".
        Expected behaviour: The user is kept in the form for adding a page and she is shown an error message.

      Technical Details:

      It seems all portlets are already able to handle any exception, not only the Layouts Admin Portlet.

      These are the key parts of the code related to this:

      • LiferayPortlet.java;processAction --> Only the exceptions checked by the isSessionErrorException are introduced as a SessionError, the rest are thrown and captured later by the render_portlet.jsp (see variable portletException that captures any exception and renders the portlet_error.jsp, which prints the message X is temporarily unavailable)
      • portlet_content_wrapper.jspf --> <liferay-theme:portlet-messages --> page.jsp contains in the bottom this taglib that will print a generic error message for any exception added to SessionErrors <liferay-ui:error />

      Therefore, it seems we could have every portlet to always print their error messages using this mechanism instead of showing the generic error.




            julio.camarero Julio Camarero (Inactive)
            julio.camarero Julio Camarero (Inactive)
            Kiyoshi Lee Kiyoshi Lee
            0 Vote for this issue
            0 Start watching this issue




                Version Package