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

JournalArticleContent.java: Include base exception within ArticleContentException

    Details

    • Type: Feature Request
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 6.1.10 EE GA1
    • Fix Version/s: None
    • Labels:
      None

      Description

      While working with Journal Articles, I found quite annoying and time consuming inonvenience. Method validateContent JournalArticleLocalServiceImpl looks like this:

      	protected void validateContent(String content) throws PortalException {
      		if (Validator.isNull(content)) {
      			throw new ArticleContentException();
      		}
      
      		try {
      			SAXReaderUtil.read(content);
      		}
      		catch (DocumentException de) {
      			throw new ArticleContentException();
      		}
      	}
      

      Everything works fine till DocumentException is thrown - it is not included within newly created ArticleContentException (it cost me 20 more minutes to find the cause of the problem).

      I suggest replacing

      		catch (DocumentException de) {
      			throw new ArticleContentException();
      		}
      

      with

      		catch (DocumentException de) {
      			throw new ArticleContentException(de);
      		}
      

      Regards,
      KG

        Attachments

          Activity

            People

            • Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              kgolebiowski Krzysztof Gołębiowski
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: