Mule 异常策略上的名称属性仅在全局异常策略上允许

Mule 异常策略上的名称属性仅在全局异常策略上允许,mule,Mule,我创建了一个全球例外策略,如下所示 <choice-exception-strategy name="GlobalExceptionStrategy"> <catch-exception-strategy name="400:BadRequest" when="#[message.inboundProperties['http.status']==&quot;400&quot;]" doc:name="400:BadRequest">

我创建了一个全球例外策略,如下所示

 <choice-exception-strategy name="GlobalExceptionStrategy">
      <catch-exception-strategy name="400:BadRequest" when="#[message.inboundProperties['http.status']==&quot;400&quot;]" doc:name="400:BadRequest">
            <logger message="Caught error with code #[message.inboundProperties['http.status']]  and reason #[message.inboundProperties['http.reason']] for query payload  #[message.payloadAs(java.lang.String)]" level="ERROR" doc:name="Logger"/>
        </catch-exception-strategy>
    </choice-exception-strategy> 


但是为什么我仍然得到像name属性这样的错误只有在全局异常策略中才是必需的呢?

错误就在这一行


使用doc:name代替name非常好

你能说得更具体些吗?代码片段名称通常只在全局元素上需要,这样就可以重用并按名称引用它,这并没有错。医生:这个名字只是为了提供信息。