Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private handleError(seed: FxSt, error: NodeSoapFaultError | any) {
const fault: NodeSoapFault11 | NodeSoapFault12 = tryGet(
error as NodeSoapFaultError,
e => e.cause.root.Envelope.Body.Fault
)
if (fault) {
const xmlFault: IXmlFault = this.convertFault(fault)
const xmlResponse = (error as NodeSoapFaultError).body
seed.set({ xmlFault, xmlResponse })
throw new SoapFaultError(
`Fault ${xmlFault.code}: ${xmlFault.description}`,
xmlFault
)
}
throw new SoapError('Unknown error', error)
}