MCPcopy Index your code
hub / github.com/simstudioai/sim / extractFaultMessage

Function extractFaultMessage

apps/sim/tools/workday/soap.ts:546–562  ·  view source on GitHub ↗
(envelope: XmlNode)

Source from the content-addressed store, hash-verified

544}
545
546function 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
564async function callOperation(
565 operation: WorkdayOperation,

Callers 1

callOperationFunction · 0.85

Calls 1

findFirstFunction · 0.85

Tested by

no test coverage detected