如何在Mule 3中返回null而不是异常消息

如何在Mule 3中返回null而不是异常消息,mule,Mule,有人能帮助我们如何返回null而不是将异常作为输出json返回吗 异常是数值“abc”无法识别。net.snowflake.client.jdbc.SnowflakeSQLException 有没有办法将null打印为输出负载,而不是打印异常 有人能帮忙吗 谢谢, 尼希尔 提取数据库:选择一个单独的流,然后使用流引用调用它 在提取的流中定义catch异常策略,并在其中将payload设置为null <?xml version="1.0" encoding="UTF-8"?> <

有人能帮助我们如何返回null而不是将异常作为输出json返回吗

异常是数值“abc”无法识别。net.snowflake.client.jdbc.SnowflakeSQLException

有没有办法将null打印为输出负载,而不是打印异常

有人能帮忙吗

谢谢, 尼希尔

提取数据库:选择一个单独的流,然后使用流引用调用它

在提取的流中定义catch异常策略,并在其中将payload设置为null

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:validation="http://www.mulesoft.org/schema/mule/validation" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/validation http://www.mulesoft.org/schema/mule/validation/current/mule-validation.xsd">
    <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9097" doc:name="HTTP Listener Configuration"/>
    <validation:config name="Validation_Configuration" doc:name="Validation Configuration"/>
    <flow name="testFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/test" allowedMethods="GET" doc:name="HTTP"/>
        <db:select config-ref="Generic_Database_Configuration" doc:name="Database">
            <db:dynamic-query><![CDATA[SELECT * FROM SALESIT_DB.SALESIT_SC3VIS_BR.abcd  trx where trx.employee_id= '1232' and trx.so_number='abc']]></db:dynamic-query>
        </db:select>
        <logger message="#[payload]" level="INFO" doc:name="Logger"/>
        <dw:transform-message doc:name="Transform Message" metadata:id="3581fe3a-a6f9-4071-b861-fcf16396358a">
            <dw:input-payload  mimeType="application/java"/>
            <dw:set-payload><![CDATA[

%dw 1.0
%output application/json
---
payload filter (($.payload != 0)) 

]]></dw:set-payload>
        </dw:transform-message>

    </flow>
</mule>