typesuite icon indicating copy to clipboard operation
typesuite copied to clipboard

Error response from NetSuite results in thrown error

Open enocom opened this issue 5 years ago • 1 comments

When NetSuite responds in an unexpected way, this library throws an error. Stack trace and error message below.

{
    "errorType": "Error",
    "errorMessage": "Element [HTML] could not be unmarshalled as is not known in this context and the property does not allow DOM content.",
    "stack": [
        "Error: Element [HTML] could not be unmarshalled as is not known in this context and the property does not allow DOM content.",
        "    at Class.unmarshalElement (/var/task/node_modules/jsonix/jsonix.js:2003:11)",
        "    at Class.unmarshalDocument (/var/task/node_modules/jsonix/jsonix.js:2130:8)",
        "    at Class.unmarshalString (/var/task/node_modules/jsonix/jsonix.js:2089:15)",
        "    at deserializeSoapResponse (/var/task/node_modules/@stedi-oss/typesuite/lib/soap.js:50:41)",
        "    at Object.sendSoapRequest (/var/task/node_modules/@stedi-oss/typesuite/lib/soap.js:85:34)"
    ]
}

enocom avatar Nov 11 '20 12:11 enocom

We saw another example of this when NetSuite responded in an expected way.

First:

ERROR	[xmldom error]	invalid doc source @#[line:0,col:undefined]

And then:


{
    "errorType": "Error",
    "errorMessage": "Argument [undefined] does not exist.",
    "stack": [
        "Error: Argument [undefined] does not exist.",
        "    at Object.ensureExists (/var/task/node_modules/jsonix/jsonix.js:792:10)",
        "    at Class.initialize (/var/task/node_modules/jsonix/jsonix.js:1104:22)",
        "    at new Class (/var/task/node_modules/jsonix/jsonix.js:44:19)",
        "    at Class.unmarshalDocument (/var/task/node_modules/jsonix/jsonix.js:2124:15)",
        "    at Class.unmarshalString (/var/task/node_modules/jsonix/jsonix.js:2089:15)",
        "    at deserializeSoapResponse (/var/task/node_modules/@stedi-oss/typesuite/src/soap.ts:62:50)",
        "    at Object.sendSoapRequest (/var/task/node_modules/@stedi-oss/typesuite/src/soap.ts:109:28)",
        "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
    ]
}

enocom avatar Dec 01 '20 12:12 enocom