Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-585

Propagate macro related exceptions to caller in xhtml parser

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.9
    • Component/s: Module - Xhtml
    • Labels:
      None

      Description

      The exceptions are swallowed this is really unpractical when using the library (example building a site using mvn-site plugin).

      The 3 cases of failure (macro execution failure, parameter issue and undefined macro) give following explanation after [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project xxx::

      Error parsing 'src/site/xhtml/macro-failure.xhtml': line [-1] Error parsing the model: Unable to execute macro in the document: toc
      Error parsing src/site/xhtml/macro-param.xhtml': line [-1] Error parsing the model: Missing 'key=value' pair for macro parameter: fail-param
      Error parsing 'src/site/xhtml/macro-undefined.xhtml': line [-1] Error parsing the model: Macro not found: undefined-macro

      Keeping as much information as possible, we can get:

      Error parsing 'src/site/xhtml/macro-failure.xhtml': line [35] Error parsing the model: Unable to execute macro in the document: toc (position: COMMENT seen ...losed tag that the toc macro will discover</p>\n<!-- MACRO{toc} -->... @35:20) caused by: org.apache.maven.doxia.macro.MacroExecutionException: ParseException: Error parsing the model: end tag name </body> must be the same as start tag <open> from line 37 (position: TEXT seen ...<!-- MACRO{toc} -->\n\n<open>\n\n</body>... @39:8)
      Error parsing src/site/xhtml/macro-param.xhtml': line [35] Error parsing the model: Invalid 'key=value' pair for macro snippet parameter: fail-param (position: COMMENT seen ...et|id=macros|file=src/site/xhtml/xhtml-macro.xhtml|fail-param} -->... @35:83)
      Error parsing 'src/site/xhtml/macro-undefined.xhtml': line [35] Error parsing the model: Macro not found: undefined-macro (position: COMMENT seen ...oes not exist: undefined-macro</p>\n<!-- MACRO{undefined-macro} -->... @35:32)

        Attachments

        1. macro-failure.xhtml
          1 kB
          Herve Boutemy
        2. macro-param.xhtml
          1 kB
          Herve Boutemy
        3. macro-undefined.xhtml
          1 kB
          Herve Boutemy

          Activity

            People

            • Assignee:
              hboutemy Herve Boutemy
              Reporter:
              hboutemy Herve Boutemy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: