Function: error()
error(
message):ErrorBody|undefined
Convenience accessor: the <Error> (negative-acknowledgment) body of a
message, or undefined. An Error is never read as a success.
Parameters
message
A parsed ScriptMessage.
Returns
ErrorBody | undefined
The Error body, or undefined when the message is not an Error.
Example
error(parseScript(xml))?.code;