Hi,
This should be triggering the fault sequence of your API/Proxy or the
default fault sequence. You can capture the error in fault sequence and
construct your error message.

Regards,
Vinod

On Wed, Jan 10, 2018 at 7:43 PM, vikram nayak <[email protected]>
wrote:

>
> Hi,
>
> Third party service which I need to consume returns “null” when it has no
> data for a particular input.
> Here is how it looks in postman when I hit third party service.
>
> [image: Inline image 1]
> [image: Inline image 2]
>
> and wso2 service console shows below erros and service gets hanged , the
> control does not come to response flow : (Error logs attached)
>
> [2018-01-10 19:34:49,145] [EI-Core] ERROR - JsonUtil #getNewJsonPayload.
> Could not save JSON payload. Invalid input stream found. MessageID:
> urn:uuid:ca4bbd52-ec0d-4fe9-9dcf-b99b5fda1b8c
> [2018-01-10 19:34:49,146] [EI-Core] ERROR - JsonStreamBuilder Error
> occurred while processing document for application/json
> java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.wso2.carbon.integrator.core.json.JsonStreamBuilder.processDocument(
> JsonStreamBuilder.java:69)
> at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.
> getDocument(DeferredMessageBuilder.java:148)
> at org.apache.synapse.transport.passthru.util.RelayUtils.
> builldMessage(RelayUtils.java:136)
>
> Please suggest how to handle this error. I want to throw some business
> exception like {"Message": "Not Data Found."}
>
> Regards,
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Vinod Kavinda
Senior Software Engineer
*WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
Mobile : +94 (0) 712 415544
Blog : http://soatechflicks.blogspot.com/
[image: http://wso2.com/signature]
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to