无法在Mule 4.2.2中获取元素XML

问题描述 投票:0回答:1

我正在尝试访问Mule 4错误对象中的error.exception.info['Element']。如果我使用如下所示的“引发错误组件”手动引发错误,它会很好地工作。 `

<choice doc:name="Choice" doc:id="c149e906-9c84-45dd-9d11-3be58e9f2d03">
            <when
                expression='#[!(some expression)]'>
                <set-variable
                    value="#['Invalid Type found for the target operation']"
                    doc:name="Error Message" doc:id="ebc156a9-7aed-4cf9-ade5-d33f382fe5b7"
                    variableName="errorMessage" />
                <raise-error doc:name="Raise error"
                    doc:id="3511b08c-9e56-4d04-aee1-d5d0b8f87670" type="MY_APP:INVALID_TYPE"
                    description="#[vars.errorMessage]" />
            </when>

`

但是如果我尝试在HTTP连接器内执行以下操作,如下所示`

<http:request method="POST" doc:name="Call Audit Endpoint" doc:id="e2a39da6-e6e3-4c33-9e6f-41d24de4d23b" config-ref="Request_Configuration" path="${http.request.path}${http.request.path.auditlog}" target="auditLog">
            <error-mapping targetType="APP:TEST" />
        </http:request>

error.exception.info ['Element']`如上。基本上,我需要访问error.exception.info ['Element']和error.exception.info ['Element XML']详细信息,以防出现任何错误。任何变通或建议都将有所帮助。谢谢!

mule mulesoft mule4
1个回答
0
投票

每个例外都是唯一的。这就是为什么它称为异常。其中之一是您手动提出的,确实具有此属性,但targetType =“ APP:TEST”没有此属性。

© www.soinside.com 2019 - 2024. All rights reserved.