Skip to content

Error when parsing a field which was not present in the xsd file #14

Description

@davidspiess

If the parser (v.0.1.1) encounters a field which is not part of the xsd, it throws the following error

Unhandled rejection TypeError: Cannot read property 'proxy' of undefined
    at SAXStream.<anonymous> (/app/node_modules/cxml/dist/xml/Parser.js:160:24)
    at emitOne (events.js:116:13)
    at SAXStream.emit (events.js:211:7)
    at SAXParser.me._parser.(anonymous function) [as onclosetag] (/app/node_modules/sax/lib/sax.js:258:17)
    at emit (/app/node_modules/sax/lib/sax.js:624:35)
    at emitNode (/app/node_modules/sax/lib/sax.js:629:5)
    at closeTag (/app/node_modules/sax/lib/sax.js:889:7)
    at SAXParser.write (/app/node_modules/sax/lib/sax.js:1436:13)
    at SAXStream.write (/app/node_modules/sax/lib/sax.js:239:18)
    at Parser._parse (/app/node_modules/cxml/dist/xml/Parser.js:187:17)
    at /app/node_modules/cxml/dist/xml/Parser.js:53:26
    at Promise._execute (/app/node_modules/bluebird/js/release/debuggability.js:303:9)
    at Promise._resolveFromExecutor (/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/app/node_modules/bluebird/js/release/promise.js:79:10)
    at Parser.parse (/app/node_modules/cxml/dist/xml/Parser.js:52:17)
    at Object.<anonymous> (/app/src/index.ts:7:23)

If my xml provider adds a new field to their api my whole application breaks until i regenerate the xsd with cxsd.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions