xmlrpc::fault (private)

 xmlrpc::fault code msg

Defined in packages/xml-rpc/tcl/xml-rpc-procs.tcl

Format a fault response to an XML-RPC request

Parameters:
code (required)
error code (integer)
msg (required)
error message
Returns:
XML-RPC fault message

Partial Call Graph (max 5 caller/called nodes):
%3 test_xml_rpc_fault xml_rpc_fault (test xml-rpc) xmlrpc::fault xmlrpc::fault test_xml_rpc_fault->xmlrpc::fault xml_doc_free xml_doc_free (public) xmlrpc::fault->xml_doc_free xml_doc_render xml_doc_render (public) xmlrpc::fault->xml_doc_render xml_parse xml_parse (public) xmlrpc::fault->xml_parse xmlrpc::invoke xmlrpc::invoke (private) xmlrpc::invoke->xmlrpc::fault xmlrpc::parse_response xmlrpc::parse_response (private) xmlrpc::parse_response->xmlrpc::fault

Testcases:
xml_rpc_fault
Source code:
    # we could build this with the tDom commands, but it's quite a pain
    # and I don't see the benefit for our simple needs - vinodk
    set result "<?xml version=\"1.0\"?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value><i4>$code</i4></value>
        </member>
        <member>
          <name>faultString</name>
          <value><string>[ns_quotehtml $msg]</string></value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>
"

    # now re-parse and then re-extract to make sure it's well formed
    set doc [xml_parse -persist $result]
    if { [catch {xml_doc_render $doc} result] } {
        return -code error  "xmlrpc::fault XML is not well formed. error = $result"
    }
    xml_doc_free $doc
    return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: