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

    Details

    • Type: Story
    • Status: Closed
    • Priority: Minor
    • Resolution: Inactive
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              julio.camarero Julio Camarero (Inactive)
              Reporter:
              julio.camarero Julio Camarero (Inactive)
              Recent user:
              Julio Camarero (Inactive)
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package