Skip to content

Allow DocumentPreProcessor.parseXML to error #220

@msimmer

Description

@msimmer

Expected Behavior

The parseXML in the DocumentPreProcessor class calls removeScriptElements, appendStyleSheets and appendScripts. Each of those methods should report errors should any be encountered. See here

Actual Behavior

Errors are not handled at all. The err variable is set to null and passed into callback.

Suggested Fix(es)

removeScriptElements, appendStyleSheets and appendScripts should be follow the callback pattern and report failure after each one is executed.

removeScriptElements(err => {
  if (err) {}
  appendStyleSheets(err2 => {
    // etc
  }
} 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions