(envelope: XmlNode)
| 544 | } |
| 545 | |
| 546 | function extractFaultMessage(envelope: XmlNode): string | null { |
| 547 | const fault = findFirst(envelope, 'Fault') |
| 548 | if (!fault) return null |
| 549 | const faultstring = findFirst(fault, 'faultstring') |
| 550 | if (faultstring?.text.trim()) return faultstring.text.trim() |
| 551 | const reason = findFirst(fault, 'Reason') |
| 552 | if (reason) { |
| 553 | const text = findFirst(reason, 'Text') |
| 554 | if (text?.text.trim()) return text.text.trim() |
| 555 | } |
| 556 | const detail = findFirst(fault, 'detail') ?? findFirst(fault, 'Detail') |
| 557 | if (detail) { |
| 558 | const msg = findFirst(detail, 'Validation_Error') ?? findFirst(detail, 'Detail_Message') |
| 559 | if (msg?.text.trim()) return msg.text.trim() |
| 560 | } |
| 561 | return 'SOAP fault returned by Workday' |
| 562 | } |
| 563 | |
| 564 | async function callOperation( |
| 565 | operation: WorkdayOperation, |
no test coverage detected